Skip to content

Documentation/swagger#19

Merged
pakeku merged 4 commits intomasterfrom
documentation/swagger
May 17, 2025
Merged

Documentation/swagger#19
pakeku merged 4 commits intomasterfrom
documentation/swagger

Conversation

@pakeku
Copy link
Copy Markdown
Owner

@pakeku pakeku commented May 17, 2025

No description provided.

@pakeku pakeku requested a review from Copilot May 17, 2025 08:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Swagger-based API documentation and updates project dependencies and documentation to support the new docs.

  • Annotates the /health route with Swagger JSDoc comments.
  • Introduces a Swagger-jsdoc config and mounts Swagger UI at /api-docs.
  • Updates dependencies in package.json and 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 user payload on req was 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

Comment thread src/documentation/swaggerOptions.ts Outdated
info: {
title: name,
version: '1.0.0',
description: 'A sample API documentation',
Copy link

Copilot AI May 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.',

Copilot uses AI. Check for mistakes.
@pakeku pakeku merged commit e1e20b1 into master May 17, 2025
3 of 4 checks passed
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.

2 participants