Swag (Go Swagger generator)
Some data may be outdated — see provenance labels.
Automatically generate RESTful API documentation with Swagger 2.0 for Go. observed · 2026-09-30
Health v2 · maintenance only
85/100
- Activity 96
- Release rhythm 63
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.
- gap_med: 195.5
- age_days: 3419
- days_rel: 37
- days_push: 26
- n_releases_24m: 5
Adoption not part of the score
13039 stars · 1547 forks observed · 2026-09-30
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
Swag converts Go source code annotations into Swagger 2.0 (OpenAPI) documentation, with a CLI generator and integrations for popular Go web frameworks like Gin. It lets developers keep API docs alongside their handlers and serve them via Swagger UI.
Use cases
- generate swagger docs from go comments
- document a gin rest api
- serve swagger ui for a go backend
- auto-generate openapi spec for go project
- keep api documentation in sync with code
- add swagger annotations to go handlers
When to choose
- you write Go web APIs and want docs generated from code comments
- you use Gin, Echo, or other supported Go frameworks and want Swagger UI integration
- you want OpenAPI/Swagger 2.0 specs without hand-writing YAML
When to avoid
- you need OpenAPI 3.x support specifically
- your API is not written in Go
- you prefer spec-first (design-first) workflows writing OpenAPI by hand
Facets
cli-tool · maturity stable
api-documentation documentation cli developer-tools developer-tools apis documentation web-development go cli cross-platform swagger openapi swagger-ui gin code-generation annotations rest-api
1 source
- readme: https://github.com/swaggo/swag · fetched 2026-09-30 · 9c4625551d9c
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| swaggo/swag | main | 85 |
| swaggo/gin-swagger | plugin | 60 |
| swaggo/echo-swagger | plugin | 72 |
| swaggo/http-swagger | plugin | 37 |
| swaggo/fiber-swagger | plugin | 56 |
For agents
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem