feat: add Swagger/OpenAPI documentation for all REST endpoints - #81
Open
AdaBebe0 wants to merge 2 commits into
Open
feat: add Swagger/OpenAPI documentation for all REST endpoints#81AdaBebe0 wants to merge 2 commits into
AdaBebe0 wants to merge 2 commits into
Conversation
Adds swagger-jsdoc + swagger-ui-express, generating an OpenAPI 3.0 spec from JSDoc annotations placed directly above each route handler in authRoutes.ts, delivery.routes.ts, deliveries.ts, and adminRoutes.ts. Shared request/response schemas and error shapes live in src/docs/swagger.ts so route files reference them via $ref instead of repeating shapes inline. The UI is exposed at /api-docs. It gets its own relaxed Content-Security-Policy scoped to that path only (swagger-ui-express requires inline script/style), while the rest of the API keeps the strict default Helmet policy. Documents every endpoint currently wired in routes/index.ts: auth login/register, delivery CRUD and archival, the driver/admin-only delivery status transition endpoint, and admin user suspension, including their real request bodies, response envelopes, and error codes as implemented in the corresponding controllers/services.
|
@AdaBebe0 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Adds swagger-jsdoc + swagger-ui-express, generating an OpenAPI 3.0 spec from JSDoc annotations placed directly above each route handler in authRoutes.ts, delivery.routes.ts, deliveries.ts, and adminRoutes.ts. Shared request/response schemas and error shapes live in src/docs/swagger.ts so route files reference them via $ref instead of repeating shapes inline.
The UI is exposed at /api-docs. It gets its own relaxed Content-Security-Policy scoped to that path only (swagger-ui-express requires inline script/style), while the rest of the API keeps the strict default Helmet policy.
Documents every endpoint currently wired in routes/index.ts: auth login/register, delivery CRUD and archival, the driver/admin-only delivery status transition endpoint, and admin user suspension, including their real request bodies, response envelopes, and error codes as implemented in the corresponding controllers/services.
Closes #58