Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenAPI support #159

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

lukasturcani
Copy link
Contributor

@lukasturcani lukasturcani commented Nov 7, 2024

This PR adds boilerpate allowing the creation of Swagger documentation via the swagger-ui-express dependency.

The first endpoint im adding is /api/v2/auto-experiments which allows the querying and filtering of auto-experiments

How it works

  • nomad-rest-api/app.js: Has a new object called swaggerDocument this object documents the api and is used to generate the Swagger docs. For each path, an object which defines the api of that path is added. I'm defining these objects in controlers/v2/auto-experiments.js so that the documentation object is next to the function it is documenting.
  • new endpoint /api-docs where you can view the swagger documentation -- see image below
  • nomad-rest-api/contorllers/auth.js - ive added a documentation boject for the auth endpoint so that it appears in the swagger docs
  • nomad-rest-api/contorllers/v2/auto-experiments.js- ive added enpoints for/api/v2/auto-expeirmentsand/api/v2/auto-experiments/download`
  • Ive added tests for the new endpoints

image

@lukasturcani lukasturcani marked this pull request as ready for review November 7, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant