swag
« Back to VersTracker
Description:
Automatically generate RESTful API documentation with Swagger 2.0 for Go
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: swagger api documentation go rest
Install: brew install swag
About:
Swag is a command-line tool that parses Go source code comments to automatically generate Swagger 2.0 API documentation. It uses declarative comments to define endpoints, parameters, and responses, keeping documentation in sync with code. This enables developers to easily create interactive API docs compatible with Swagger UI.
Key Features:
  • Parses Go annotations to generate Swagger 2.0 spec
  • Supports multiple frameworks like Gin, Echo, and standard net/http
  • Generates Swagger UI for interactive API testing
  • CLI tool for easy integration into build pipelines
Use Cases:
  • Automating API documentation generation for Go web services
  • Maintaining up-to-date docs by embedding them in source code
  • Providing interactive API exploration for frontend teams
Alternatives:
  • go-swagger – More feature-rich but heavier; Swag is simpler and annotation-focused
  • OpenAPI-generator – Broader language support; Swag is Go-specific and lightweight
Version History
Detected Version Rev Change Commit
Oct 9, 2025 11:03am 0 VERSION_BUMP bda9005c
Sep 26, 2025 11:07pm 0 NEW ee3e42bb