swaggo

    swaggo/swag

    Automatically generate RESTful API documentation with Swagger 2.0 for Go.

    13.0K stars
    1.5K forks
    100 GitHub watchers
    Updated Nov 7, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    Loading star history...

    Where it stands

    Rank, growth pace and release cadence relative to everything GStars tracks.

    1 release in the last 90 days, the latest 55 days ago, with 251 contributors on GitHub.

    Use Cases & Benefits

    • Generates Swagger 2.0 RESTful API documentation automatically from Go source code annotations.
    • Enables seamless integration with multiple Go web frameworks for consistent, up-to-date API docs without manual maintenance.
    • Use for documenting Go APIs in projects using Gin to provide interactive Swagger UI documentation.
    • Use for generating standardized API docs in microservices architectures to ensure consistent API contracts across teams.
    • Use for automating API documentation updates in CI/CD pipelines to keep docs synchronized with code changes.

    Should you depend on it?

    License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.

    License

    MIT

    Permissive: commercial use, modification and redistribution are allowed with attribution.

    Community files

    • README: present
    • Contributing guide: present
    • Code of conduct: present

    Watch-outs

    No watch-outs from GStars' checks.

    General guidance from repository metadata, not legal advice. How we score

    From the README

    Swag converts Go annotations to Swagger Documentation 2.0. We've created a variety of plugins for popular Go web frameworks. This allows you to quickly integrate with an existing Go project (using Swagger UI).

    To build from source you need Go (1.19 or newer).

    Alternatively you can run the docker image:

    Or download a pre-compiled binary from the release page.

    Make sure to import the generated docs/docs.go so that your specific configuration gets init'ed. If your General API annotations do not live in main.go, you can let swag know with -g flag.

    Excerpt from the swaggo/swag README on GitHub (MIT license). © its authors.Read the full README on GitHub

    Daily snapshots

    Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots

    Forks

    1.5K-57

    Open issues

    485+15

    Compared with peers in API

    Fastest-growing repositories GStars tracks in this cohort for the week of Nov 8, by 7-day star growth

    swaggo/swag compared with API repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    anthropics/claude-quickstarts20.5K+73375—
    vxcontrol/pentagi33.9K+7197536 days ago
    N4darae/shrt2.6K+5298—
    agentgateway/agentgateway6.1K+1877514 days ago
    swaggo/swag13.0K—6255 days ago
    BenedictKing/ccx4.0K—32117 days ago
    Category median6.1K+62475—

    Discover Repositories

    Search across tracked repositories by name or description