Swagger API
This page aims to guide the developer on how to use the swagger API for api testing / documentation purposes.
Last updated
Was this helpful?
This page aims to guide the developer on how to use the swagger API for api testing / documentation purposes.
Last updated
Was this helpful?
Swagger API is a powerful framework which helps to dynamically add / update the API accordingly when changes are made to them.
It dynamically adds these items into Swagger API page:
Schemas
Backend API Endpoint(s)
Swagger API is built into the project so starting the application is required in order to view the swagger API for testing or reading the swagger documentation.
You have to start the application first.
navigate to this directory: If the application is currently running on localhost, you can click on the link below and it will navigate to the directory directly. http://localhost:5000/swagger-ui/ <---- click here to navigate directly
Should be welcome with this screen
Toggle any of the Title to open a dropdown. It will show the list of API's and show more documentation and details as to how to use the API.
Click on any of them to test out the API. Here it will show the API query that is required to be passed. the dropdown will show the possible values. this is not available for each and every query but only specific to some.
Scrolling down further, it will show the possible responses and example object which is shown when data is successfully executed.
After picking any API and opening its content details. you can click on "try it out" button.
Follow the instructions coloured in purple and meet the criteria based on the instruction. If done correctly, the responses tab below will update to reveal the data retrieved from the database.
Result from the execution
The api url + how the execution via the url is shown and the developers can use this API on the frontend.