Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS]: Updates Swagger documentation decorators for API endpoints in a NestJS application on Waitlist and Newsletter Subscription Module #1325

Open
na-cho-dev opened this issue Mar 1, 2025 · 0 comments · May be fixed by #1333
Labels
approved documentation Improvements or additions to documentation

Comments

@na-cho-dev
Copy link

na-cho-dev commented Mar 1, 2025

Description

The Swagger documentation for the waitlist module does not include proper authorization details for the createWaitlistDocs function, and that for the Newsletter Subscription does not include proper response documentation.

Current Documentation

The createWaitlistDocs function does not include any authorization details, which may lead to confusion about the required authorization for this endpoint, and the Newsletter Subscription does not include documentation for various response.

Proposed Changes

  • Add the ApiBearerAuth decorator to the createWaitlistDocs function to indicate that the endpoint requires authorization.
  • Enhance the createWaitlistDocs and getAllWaitlistDocs functions to include detailed examples for each response status.
  • Update the ErrorResponseDto class to include examples for different error scenarios.
  • Updated newsletter-subscription.controller.ts to use newsletter-subscription-swagger.docs.ts for documentation.
  • Added various dto files for error responses in the the documentation.

Steps to Reproduce

  1. Open the Swagger UI for the waitlist module.
  2. Navigate to the endpoint for creating a new waitlist entry.
  3. Observe that there is no authorization information provided.

Motivation

The getAllWaitlistDocs function already includes the ApiBearerAuth decorator, so the createWaitlistDocs function should be updated to match this behavior. Additionally, providing detailed examples for each response status will improve the clarity and usability of the Swagger documentation for both waitlist and newsletter subscription modules.

Acceptance Criteria

  1. The createWaitlistDocs function should include an ApiBearerAuth decorator to indicate that the endpoint requires authorization.
  2. The createWaitlistDocs and getAllWaitlistDocs functions should include detailed examples for each response status.
  3. Separate DTOs for each error type should be created to include examples for different error scenarios.
  4. Both waitlist and newsletter subscription should have proper documentation for various response type.
@na-cho-dev na-cho-dev added the documentation Improvements or additions to documentation label Mar 1, 2025
@na-cho-dev na-cho-dev changed the title [DOCS]: Updates Swagger documentation decorators for API endpoints in a NestJS application on Waitlist Module [DOCS]: Updates Swagger documentation decorators for API endpoints in a NestJS application on Waitlist and Newsletter Subscription Module Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved documentation Improvements or additions to documentation
Projects
None yet
2 participants