Skip to content

Swagger

Dylan Barkowsky edited this page Apr 18, 2023 · 4 revisions

About Swagger

Swagger is a documentation tool which uses OpenAPI standards to create a living documentation page.

On this page, users can view available REST API resources and their methods, plus the associated requests and responses expected with those methods.

Swagger also provides in-documentation testing of these methods by using a running instance of your API.

Learn more at Swagger.

Viewing Documentation

To view the documentation in this project, navigate to the Swagger page located at /api/docs.

For example, if running the application on localhost and using port 3004, you should be able to view the Swagger documentation at http://localhost:3004/api/docs.

Using the Documentation

When viewing the Swagger page as indicated above, click on a method to expand its features.

From here, you can see the method type, the parameters needed, and the request body expected.

Below that, the expected response codes and their possible contents are displayed.

There is also a Try it out button near the top of the method. By selecting this, you can submit a request to the live API to test that method.

Editing Documentation

Documentation for this this API is stored in YAML files under the /api/docs folder. Each file corresponds to a single resource.

Repeating objects can be stored under components, while the information for each resource is defined under paths.