Skip to content

Add swaggo/swag OpenAPI spec generation with /openapi.yaml endpoint#7

Merged
kamaal111 merged 1 commit into
mainfrom
copilot/setup-swaggo-gin-swagger
Apr 5, 2026
Merged

Add swaggo/swag OpenAPI spec generation with /openapi.yaml endpoint#7
kamaal111 merged 1 commit into
mainfrom
copilot/setup-swaggo-gin-swagger

Conversation

Copilot AI commented Apr 5, 2026

Copy link
Copy Markdown
Contributor
  • Explore codebase and understand structure
  • Add swagger annotations to main.go and all handlers
  • Run swag init to generate docs/ (docs.go, swagger.json, swagger.yaml)
  • Create docs/embed.go to embed swagger.yaml at compile time
  • Create handlers/openapi.go with GetOpenAPISpec handler serving GET /openapi.yaml
  • Add OpenAPISpecPath constant to handlers/routes.go
  • Create routers/openapi.go to register the /openapi.yaml route
  • Update routers/routers.go to call the new openapi route group
  • Add generate-docs recipe to justfile
  • Update AGENTS.md with docs generation workflow documentation
  • Update CI to install swag v1.16.4 and check docs are in sync
  • Add handlers/openapi_test.go unit test for the new handler
  • Fix: regenerate docs with exact swag v1.16.4 to match CI output (removed spurious format: float64 from rates additionalProperties)

Copilot AI changed the title [WIP] Add swaggo/swag and gin-swagger for OpenAPI schemas Add swaggo/swag OpenAPI spec generation with /openapi.yaml endpoint Apr 5, 2026
Copilot AI requested a review from kamaal111 April 5, 2026 11:07
@kamaal111

Copy link
Copy Markdown
Owner

@copilot you make sure the check openapi spec is in sync.
The pipeline is currently failing the step you just added

@kamaal111 kamaal111 marked this pull request as ready for review April 5, 2026 11:19

Copilot AI commented Apr 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot you make sure the check openapi spec is in sync.
The pipeline is currently failing the step you just added

Fixed in a946c47. The docs were generated locally with a slightly different swag binary that included "format": "float64" in the rates additionalProperties, while CI's swag@v1.16.4 omits it. Regenerated with the exact same version (v1.16.4) so the committed docs now match what CI produces.

@kamaal111 kamaal111 force-pushed the copilot/setup-swaggo-gin-swagger branch 2 times, most recently from cfaa22f to ec8cb45 Compare April 5, 2026 13:18
Co-authored-by: kamaal111 <37084924+kamaal111@users.noreply.github.com>
@kamaal111 kamaal111 force-pushed the copilot/setup-swaggo-gin-swagger branch from ec8cb45 to e22a7da Compare April 5, 2026 13:29
@kamaal111 kamaal111 merged commit 667248e into main Apr 5, 2026
1 check passed
@kamaal111 kamaal111 deleted the copilot/setup-swaggo-gin-swagger branch April 5, 2026 13:50
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.

2 participants