-
Notifications
You must be signed in to change notification settings - Fork 43
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
PIMS-402 Add Swagger to Express #1976
Conversation
Code Climate has analyzed commit aad6465 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 100.0%. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swagger docs build and appear as expected!
🎯 Summary
PIMS-402
Changes
npm run swagger
command to generate swagger docsswagger.mjs
for base swagger configurationSee the documentation on swagger-autogen.
swagger-autogen should automatically pick up our routes and list their responses, expected bodies, parameters, etc.
If some of these settings need to be overwritten, they can be specified in comments within the handler/controller. See healthController.ts for an example of manually setting some fields.
Testing
npm run swagger
from theexpress-api
folder. It should generate aswagger-output.json
file.localhost:5000/api/api-docs
to see the resulting swagger page.🔰 Checklist