SwaggerUI
This tutorial shows how to use SwaggerUI to create a document and to list views.
Create a document with SwaggerUI
-
Go to SwaggerUI.
-
Provide the server variables as shown:
- Provide the JWT token for authorization: Go to the authorization API in swaggerUI, provide valid credentials and execute. Then a bearer token will be generated which is nothing but a JWT token
-
Enter JWT token and click authorize.
-
Go to the required API and provide all the mandatory field values. Execute:
List views with SwaggerUI
-
Follow Steps of authorization from above.
-
Go to the required API and provide the dataSource value. Execute.
View the SwaggerUI for a specific KEEP Database
-
In the Explore field in the banner, enter “/api/v1/openapi?dataSource=demo”. This will display the KEEP OpenAPI specification specifically for the demo database.
-
Review the endpoints. The admin and design APIs are not included, because they are not appropriate for accessing the demo database’s data. The
dataSource
parameter is always “demo” because the OpenAPI specification is for that Keep database. -
Review the Schemas at the bottom. If you have not specified read / write fields on a form, you will see the genericFormResult / genericFormRequest. If you have specified read or write fields, you will see a schema for “formName-modeName Responses” / “formName-modeName Requests”.
If you URL encode “/api/v1/openapi?dataSource=demo” you can create a URL to share with developers who consume the KEEP API for that database. The URL encoded value should be appended as the “url” querystring parameter. The resulting URL will look like “http://localhost:8880/openapi/index.html?url=/api/v1/openapi%3FdataSource%3Ddemo”, where the KEEP database name is after the “%3D” (url encoded “=”).