qmetrics.net

Swag

Go annotation-driven Swagger 2.0 API documentation generator

Swag reads declarative comments in Go source and emits Swagger 2.0 specs plus a docs package for frameworks such as Gin. A CLI formats comments, initializes docs, and supports Docker or binary installs.

Overview

Swag converts structured comment annotations in Go code into Swagger Documentation 2.0 for REST APIs. Plugins and examples cover popular web frameworks so generated specs can feed Swagger UI alongside existing services.

Workflow starts with annotated general API info and per-route operation comments, then runs swag init in the module root to produce a docs folder and docs.go you import at startup. Optional swag fmt normalizes comment formatting similar to go fmt.

The comment format documents parameters, request bodies, responses, security schemes, enums, multipart uploads, markdown descriptions, generics, and model overrides. Gin integration sets Swagger metadata programmatically and wires UI routes after generation.

Install options include go install, Docker, or release binaries. Output types can be narrowed when you need only specific documentation artifacts.

Key features

  • Swagger 2.0 generation
  • Declarative Go comments
  • Gin framework integration
  • swag fmt comment formatter
  • Security and auth annotations
  • Multipart and file upload docs
  • Custom type override hooks
  • Docker or binary install

Use cases

  • Documenting Go REST APIs
  • Swagger UI with Gin
  • OpenAPI-style team handoffs
  • Keeping docs near handlers
  • Generating client-facing specs

Tags

Similar software

Swagger UI

Interactive OpenAPI reference documentation UI

Swagger UI renders OpenAPI and standalone JSON Schema specs as browsable, try-it-out API documentation in the browser. It ships as npm packages or static assets for your site.

★ 29.1k⟳ 4 days agoApache-2.0

ReDoc

OpenAPI and AsyncAPI reference documentation generator

Redoc turns OpenAPI, AsyncAPI, and GraphQL schema files into browsable API reference pages. It ships as static HTML, a React component, or CLI output with a three-panel layout.

★ 26k⟳ 8 days agoMIT

Scalar

OpenAPI-native API references, client, and docs tooling

Scalar is an open-source API platform centered on OpenAPI and Swagger. It offers interactive API references, an offline-first API client, and related docs and agent-facing tooling.

★ 16.5k⟳ todayMIT
Open Source Alternative to:Postman

ShowDoc

Online API and technical documentation for IT teams

ShowDoc helps IT teams publish and share API docs, data dictionaries, and technical manuals online. It targets clearer collaboration than scattered Word files or chat attachments.

★ 12.9k⟳ 6 days agoApache-2.0 · open core

axios

Promise-based HTTP client for browser and Node.js

Axios is a promise-based HTTP client for JavaScript environments in the browser and Node.js. It supports common request methods, configurable defaults, and interceptors for request and response handling.

★ 109.5k⟳ 2 days agoMIT

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT