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
#162727461 Document api with swagger #21
#162727461 Document api with swagger #21
Conversation
setup swagger configuration use swagger jsdoc in authrouter [Delivers #162727461]
authRouter | ||
.post('/signup', | ||
UserValidator.UserSignUpValidator, | ||
emailCheck, | ||
UserController.signUp); | ||
/** | ||
* @swagger |
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.
Please, I would like to know if there is a reason for using swagger JSDOCs against Swagger.json where the documentation is kept in a different file. I feel using swagger.json file and having all the documentation there is cleaner because adding documentation to the route file will make it unavoidably long and I don't think we want that. Anyone going through the route file will have to read the doc of each of them.
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.
This approach works fine for our project, because the controllers have separate route files, for reference purposes please check here https://github.com/Surnet/swagger-jsdoc/blob/master/example/v2/routes.js
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.
Ok.
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.
LGTM
What does this PR do?
Document application API with swagger
Description of Task to be completed?
localhost:9000/api/v1/api-docs
How should this be manually tested?
npm i
localhost:9000/api/v1/api-docs
, and make request to any endpointAny background context you want to provide?
N/A
What are the relevant pivotal tracker stories?
#162727461
Screenshots (if appropriate)