What problem does it solve?
golang-swagger reduces the gap between Go API implementations and published OpenAPI/Swagger documentation by ensuring handlers, models, and security requirements are consistently described through annotation-driven generation.
Core Features & Use Cases
- Generates Swagger/OpenAPI specs with swaggo/swag: Produces docs from annotation comments such as @Summary, @Param, @Success, @Router, and @Security, then runs swag init to create the docs/ package.
- Wires Swagger UI into multiple Go HTTP frameworks: Supports gin, echo, fiber, chi, and net/http integrations by registering the Swagger UI endpoint (commonly at /swagger/index.html).
- Improves schema fidelity and security accuracy: Uses struct tags (swaggertype, enums, example, swaggerignore) and security definitions (Bearer/JWT, OAuth2, API key) so the UI reflects how clients must call your API.
Quick Start
Use the golang-swagger skill to annotate your Gin handlers with @Summary, @Param, @Success, and @Router, then run swag init to generate the docs package and mount the Swagger UI at /swagger/index.html.