github.com/swaggo/swag

swag

Package swag converts Go annotations to Swagger Documentation 2.0.

95

Decision Signals

Health score 95/100, confidence 95/100.

Excellent
Maintenance 95
Adoption 100
Security 92
Maturity 94
Developer DX 91
Confidence 95

Install

go get github.com/swaggo/swag

Package Data

updated May 29, 2026
Latest versionv1.16.6
Imported by11.8K packages
Stars12.8K
Forks1.4K
Last activity14 days ago
Latest releasev2.0.0-rc5 (4 months ago)
LicenseMIT
Known vuln records0

API Surface

203 symbols
SymbolKindSynopsis
AstFileInfo Type type AstFileInfo struct{ ... }
AstFileInfo.File Field File *ast.File
AstFileInfo.FileSet Field FileSet *token.FileSet
AstFileInfo.PackagePath Field PackagePath string
AstFileInfo.ParseFlag Field ParseFlag ParseFlag
AstFileInfo.Path Field Path string
ConstVariable Type type ConstVariable struct{ ... }
ConstVariable.Comment Field Comment *ast.CommentGroup
ConstVariable.File Field File *ast.File
ConstVariable.Name Field Name *ast.Ident
ConstVariable.Pkg Field Pkg *PackageDefinitions
ConstVariable.Type Field Type ast.Expr

Similar Packages

Go OpenAPI Libraries

#1 Huma

Huma REST/HTTP API Framework for Golang with OpenAPI 3.1

Go OpenAPI Libraries 4.1K stars 10 imported-by 100% confidence
96

#2 Goa

Package goa implements a Go framework for writing microservices that promotes best practice by providing a single source of truth from which server code, client code, and documentation is derived.

Go OpenAPI Libraries 6.1K stars 2.0K imported-by 100% confidence
95

#3 grpc-gateway

gRPC to JSON proxy generator following the gRPC HTTP spec

Go OpenAPI Libraries 19.9K stars 0 imported-by 95% confidence
95

#4 swag

Package swag contains a bunch of helper functions for go-openapi and go-swagger projects.

Go OpenAPI Libraries 220 stars 16.2K imported-by 95% confidence
94

#5 validate

Package validate provides methods to validate a swagger specification, as well as tools to validate data against their schema.

Go OpenAPI Libraries 144 stars 5.9K imported-by 95% confidence
94