-
-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
feat(api): API documentation with Swagger UI #49791
feat(api): API documentation with Swagger UI #49791
Conversation
👀 Review this PR in a CodeSee Review Map |
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.
Nice one, Niraj
I do not think it matters much, but, if not, then a nice-to-have would be on |
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.
Why would we want to enable this in production? I thought it was just a tool to help us develop the api.
We are hoping to provide a REST API for other tools to use. So, our API should be documented somewhere. |
To be clear, irrespective of whether we use the UI in production or development, we can't execute any of the endpoints coz of the restriction I mentioned in the description. It will just be like an API reference page. |
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.
Thank you, Niraj
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.
I have reservations about the approach we're taking to env vars, but that's broader than this PR.
Putting them aside for now, this LGTM. Nice work @Nirajn2311 🚀
Checklist:
main
branch of freeCodeCamp.Closes #49712
To view the documentation, start the server and visit
http://localhost:3000/documentation/
. One thing to note is even though if you set the session ID the page can't send the request with the cookie for security reasons regarding modifying request headers in browser(More details here swagger-api/swagger-js#1163).Also do we need the documentation page for production?