Skip to content

Add Swagger Documentation #22

Description

@amorindev

Description

Swagger documentation must be added to the API to provide clear and interactive documentation for all available endpoints. Since the API is developed using versioning, Swagger must support versioned documentation.

Requirements

  1. Integrate Swagger with the current Go API (net/http).
  2. Generate Swagger documentation from code annotations.
  3. Expose the Swagger UI endpoint.
  4. Support API versioning.

Swagger Structure

  • The basic Swagger information (title, description, etc.) must be defined inside main.
  • Each API version will have its own documentation inside cmd/api/server/v1.
  • In the New function of each version, version-specific annotations must be added, for example: // @BasePath /api/v1.
  • The generated Swagger code must be located inside cmd/api/server/v1/api-docs.

Notes

  • If the implementation requires additional tooling or configuration changes, they should remain minimal and consistent with the current setup.
  • Testing is not required for this issue.
  • Questions or better solutions should be discussed in the issue comments.

Resource

https://medium.com/@fernandoamorindev/documenting-an-api-in-golang-with-net-http-and-swagger-a3fd58c6f96c

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions