swaggo/swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 31 minutes ago
Added to GitGenius on September 4th, 2026
Created on June 10th, 2017
Open Issues & Pull Requests: 476 (+0)
GitHub issues: Enabled
Number of forks: 1,560
Total Stargazers: 13,009 (+0)
Total Subscribers: 114 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 7.5 days
Mean response time: 65.7 days
90th percentile: 171.2 days
Tracked items: 190

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. 73% of tracked open issues have had no activity in three months, so the open count overstates what is actively being worked. Only 4% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 159
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 656 days
Stale 30+ days: 154
Stale 90+ days: 138

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (7)
  • feature (6)
  • enhancement (3)
  • question (3)
  • v2 (3)
  • invalid (2)
  • help wanted (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Swag is a code generation tool that automatically produces Swagger 2.0 API documentation from Go source code annotations.

The tool solves the problem of keeping API documentation synchronized with implementation by parsing declarative comments embedded directly in Go code. Developers annotate their API handlers with structured comments describing endpoints, parameters, request bodies, responses, and security requirements. Swag then generates a complete Swagger 2.0 specification and integrates it with popular Go web frameworks through dedicated plugins, allowing the documentation to be served alongside the running application via Swagger UI.

Swag suits projects where developers want to maintain API documentation close to the code that implements it, reducing the friction of keeping specs in sync with changes. It works with established Go web frameworks through framework-specific plugins. The tool supports advanced features including custom type mappings through struct tags, field exclusion, multi-line descriptions, generic types, security annotations, and enum documentation. Teams should choose this approach if they prefer annotation-driven documentation over maintaining separate specification files, and if they want generated docs to be part of their build process rather than a manual step.

The project maintains active development with regular commits addressing bug fixes and feature additions. Pull requests receive timely review and integration. The codebase shows consistent attention to test coverage and code quality. Documentation is comprehensive and regularly updated to reflect new capabilities and usage patterns.