Stoplight

Stoplight is an API design, development, and documentation platform for consistency, reusability, and quality, providing a simple and enjoyable developer experience.

We will be using Stoplight to write documentation of endpoints. We also can use Stoplight to test an API on different environment.

Prerequisite 1 : User Access

Please reach out to your senior programmer, providing your wavelet’s email address so that you could be granted the edit access to the organisation’s stoplight project and workspace.

Prerequisite 2 : Installation

You may access to Bigledger stoplight documentation via Stoplight Web at link:https://bigledger.stoplight.io/.

However, it is recommended to install the Stoplight Studio and clone the api repositories locally for speedier edit. You can download the Stoplight Studio by clicking here

stoplight-download

Please select the right installer suitable to your operating system.

Prerequisite 3 : Steps to Clone the Repositories

  1. Login to Stoplight Studio usign your wavelet.net email credentials

  2. Clone the Repository:

    1. Public Repository (To create the tenant level APIs documentation)

    2. Private Repository (To create the documentation for platform level APIs)

    3. Insert the URL of the repository and click the Clone button clone-repository

    4. Fill in your Username and App Password to clone the repositories (scroll down to see how to get the credentials). stoplight-authentication

      1. Use your username under Account Settings and create App Password under App Passwords. bitbucket-profile

      2. Click on Create app password app-passwords

      3. Write a label, check the required permissions and click the Create button.

        • Note: Remember to note down your credentials add-app-passwords

  3. Repositories are cloned and ready to create the API documentation.

Create API Documentation

  • Click the '+' button and click on API add-new-api

  • Type the File name and select the latest Version and choose the YAML format add-new-api-file

  • Right click on the Paths to create the new Path create-new-path

  • Type the path/url of the API add-path-name

  • Type the Operation name and Description operation-details

  • Right click on the Models to create the new Model create-new-model

  • Click on Generate from JSON to create Model using JSON body OR click on '+' button to add manually model-schema

  • Click on the 'String' select the TYPE set-field-type

  • Click on the three dots to update the other Properties like format set-field-format

  • Click on the book icon to write the Description set-field-description

  • Click on the 'Preview' button to view the Model schema-example

  • Right Click on the Request Bodies to create New Request Body create-new-request-body

  • Write the Request Body Description request-body-description

  • Click on 'Generate from JSON' to create new Request Body generate-request-body-json

  • Paste or Write a JSON body, then click Generate to build a schema generate-request-body-json2

  • Click on the book icon to write the Description request-body-field-description

  • Click on the Example to create an Example body request-body-example-creation

  • Write the name and body, then click on 'Add Body' request-body-example-creation2

  • Right Click on the Responses to create New Response create-new-response

  • Select the Type then select the Target and component set-response-reference

  • To Generate from JSON, Click on Generate from JSON generate-response-json

  • Write the Json body and click on 'Add Body' generate-response-json-add-body

  • Click on the 'Example' to add an Example create-response-example

  • Write the name and Example, then click 'Add Body' add-response-example-body

  • Right Click on the Parameters to create New Parameter create-new-parameters

  • Write the Parameter name, select the Type, write the description and add the properties parameter-details

  • Click the Header to add the Header for an Operation under Paths add-header-parameter-in-endpoint

  • Select the Target and search for the relevant Header set-parameter-reference

  • Choose the headers choose-parameter-reference

  • Select the Request Body add-response-body-in-endpoint

  • Click on Response to create a new response and choose the Response code and relevant response add-response-in-endpoint

  • Click on 'Try It' to test the endpoint. Fill up the required data and choose the Server, then click on 'send API Request' test-post-endpoint

  • Click on the required operation to create a new Operation documentation create-new-operation

  • Write the details and add the required data add-details-and-headers

  • Click the Query Param to add the new Query Parameters add-query-params

  • Set the Query Parameters from the reference target set-query-param-ref-target

  • Add the Response for the new endpoint add-get-endpoint-response

  • Click on 'Try It' to test the endpoint. Fill up the required data and choose the Server, then click on 'send API Request' test-get-endpoint

  • You will get the response get-endpoint-test-response

  • Click on the highlighted icon to add Tags. Create the same Tags for the Same Controller endpoints. add-new-tags