Skip to content

feat: add Swagger/OpenAPI documentation for all REST endpoints - #81

Open
AdaBebe0 wants to merge 2 commits into
SwiftChainn:mainfrom
AdaBebe0:feat/swagger-docs
Open

feat: add Swagger/OpenAPI documentation for all REST endpoints#81
AdaBebe0 wants to merge 2 commits into
SwiftChainn:mainfrom
AdaBebe0:feat/swagger-docs

Conversation

@AdaBebe0

Copy link
Copy Markdown

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

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.
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

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.

Backend: Generate Swagger/OpenAPI documentation for all REST endpoints

1 participant