Skip to content

Add Swagger documentation for user routes - #282

Open
cyber-shehan wants to merge 1 commit into
dev-backendfrom
swagger-user-routes
Open

Add Swagger documentation for user routes#282
cyber-shehan wants to merge 1 commit into
dev-backendfrom
swagger-user-routes

Conversation

@cyber-shehan

Copy link
Copy Markdown
Collaborator

This PR adds Swagger/OpenAPI documentation for the User Service routes to improve API documentation and make the endpoints easier to understand and test through Swagger UI.

The documentation includes:
• Endpoint summaries and descriptions.
• Appropriate tags for grouping endpoints.
• Bearer authentication requirements for protected endpoints.
• Path parameter documentation where applicable.
• Response documentation for successful and error responses.

Swagger annotations were added to the route definitions to generate the API documentation.

Documented Endpoints

Health
• GET /api/users/health

Metadata
• GET /api/users/meta/locations
• GET /api/users/meta/event-statuses
• GET /api/users/meta/linked-event-types
• GET /api/users/meta/seasons
• GET /api/users/meta/reference-days
• GET /api/users/meta/reference-times

Integration
• GET /api/users/integration
• GET /api/users/integration/{integrationId}
Training Models
• GET /api/users/training-models
• GET /api/users/training-models/{file_id}

Users
• GET /api/users/user

Dashboard
• GET /api/users/dashboard/overview
• GET /api/users/dashboard/charts
• GET /api/users/dashboard/activity

Hazards
• GET /api/users/hazards
• GET /api/users/hazards/{hazardId}

Testing
• Verified that all documented endpoints are displayed correctly in Swagger UI.
• Tested the documentation locally using:
◦ npm run dev:gateway
◦ npm run dev:user
• Confirmed that protected endpoints correctly require authentication and return401 Unauthorized when accessed without a valid token.

Notes
This PR only adds Swagger/OpenAPI documentation and related Swagger annotations. No business logic or endpoint behaviour was intentionally modified.

Screenshot 2026-07-30 120745 Screenshot 2026-07-30 120727

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.

1 participant