Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds Swagger-based API documentation and updates project dependencies and documentation to support the new docs.
- Annotates the
/healthroute with Swagger JSDoc comments. - Introduces a Swagger-jsdoc config and mounts Swagger UI at
/api-docs. - Updates dependencies in
package.jsonand refreshes README to include Swagger setup.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/routes/healthRoute.ts | Added Swagger JSDoc for the /health endpoint. |
| src/midleware/authMiddleware.ts | Removed a comment explaining the custom Request payload. |
| src/documentation/swaggerOptions.ts | Created the Swagger-jsdoc options and export. |
| src/app.ts | Mounted Swagger UI under /api-docs. |
| package.json | Updated dependencies, added Swagger packages, removed "type": "module". |
| README.md | Added Swagger UI badge and restructured env var docs. |
Comments suppressed due to low confidence (2)
package.json:5
- Removing
"type": "module"will switch Node to CommonJS by default and break ES module imports; consider restoring it or adjusting your build to maintain ES module support.
"type": "module",
src/midleware/authMiddleware.ts:9
- [nitpick] The comment explaining the custom
userpayload onreqwas removed; consider re-adding or relocating this note next to the actual interface augmentation so future readers understand the extended Request type.
// Extend the Request interface to include the user payload from the token
| info: { | ||
| title: name, | ||
| version: '1.0.0', | ||
| description: 'A sample API documentation', |
There was a problem hiding this comment.
[nitpick] The Swagger description is very generic; consider updating it to describe this service’s specific functionality for clearer API docs.
Suggested change
| description: 'A sample API documentation', | |
| description: 'API for managing user accounts, including creation, retrieval, updating, and deletion of user data.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.