OPEN SWAG GO
DOCUMENTATION

open-swaggo Documentation

A Go library that generates OpenAPI 3 documentation from co-located struct definitions and standard struct tags — served with a modern Scalar UI, a built-in try-it console, and first-class adapters for Gin, Echo, Fiber, Chi, and net/http.

3 min readv1.1.1Updated Apr 2026

What You'll Find Here

This documentation walks you through every layer of open-swaggo — from installing the CLI and writing your first annotations, to generating production-grade OpenAPI specs for complex Go services.

  • Struct-Based DefinitionsDescribe endpoints as openswag.Endpoint values co-located with your handlers, and let schemas be derived from standard Go struct tags (json, example, format, swagger).
  • Modern Scalar UIServe interactive docs with a built-in Scalar UI — dark mode, predefined themes (purple, blue, green, light), and an in-browser try-it console.
  • Framework-AgnosticFirst-class adapters for Gin, Echo, Fiber, Chi, and net/http — drop it into an existing codebase without refactoring your router.
  • Try-It Console & SnippetsSend live API requests from the docs and copy ready-to-use code snippets in curl, JavaScript, Go, and Python — plus a Bearer / API Key / Basic / Cookie auth playground.

Quick Install

Add open-swag-go to your project with a single go get command, then pull in a framework adapter if you need one.

terminal.sh
BASH
12
go get github.com/gopackx/open-swag-gogo get github.com/gopackx/open-swag-go/adapters/gin
UTF-8 · LF · bash · 2 lines