Skip to content

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

@na-cho-dev

Description

@na-cho-dev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    approveddocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions