...
The best way to visualize and interact with the API is through Swagger.
Using Swagger Editor on the web
With Swagger Editor, you can view and edit the OpenAPI document inside your browser, while previewing the documentation in real time.
Visit https://editor.swagger.io/ and select File → Import file, or drag-and-drop the openapi.json
file into the browser window.
You can then view and make edits to the OpenAPI document in the left panel (in YAML format) and visualize the UI in the right panel, or simply drag the divider all the way to the left if you are only interested in the UI.
Installing Swagger Editor locally
Swagger Editor can also be installed locally with https://github.com/swagger-api/swagger-editor, or by cloning the repository.
...
Then open index.html
and import openapi.json
.
You can then make edits to the OpenAPI document in the left panel (in YAML format) and visualize the UI in the right panel.
...
or drag-and-drop into the browser window.
Using Swagger UI standalone
If you do not need to view or edit the OpenAPI document, you can simply also use a standalone version of Swagger UI.
The tool https://github.com/vajahath/open-swagger-ui will allow you to open a local openapi.json
file in the Swagger UI.
It requires Node.js >=10
and can be installed via npm:
Code Block |
---|
npm i -g open-swagger-ui |
Then, change to make sure you are in the directory containing openapi.json
(or point the command to where it is located) and run:
Code Block |
---|
open-swagger-ui .\openapi.json --open |
...