Generate OpenAPI specs
from Go structs & tags.
open-swaggo derives docs from your Go struct values and standard struct tags (json, validate, example) at runtime via reflection — no codegen, no committed spec files, every major framework supported.
Everything you need to ship great API docs
Built for Go developers who value simplicity, performance, and correctness.
5 Framework Adapters
First-class support for Chi, Gin, Echo, Fiber, and net/http. Mount docs with a single line of code.
Auth Playground
Test Bearer, Basic, API Key, Cookie, and OAuth2 flows directly in the docs UI.
Try-It Console
Send live API requests with environment management, request history, and auto-generated code snippets.
Schema Generation
Derive OpenAPI schemas from Go structs using standard tags — json, validate, example, and more.
Version Diffing
Compare spec versions, detect breaking changes, and generate migration guides automatically.
Theming & Scalar UI
Predefined themes, dark mode, and custom CSS via Scalar integration for beautiful output.
Code Snippets
Generate ready-to-use code in curl, JavaScript, Go, Python, and PHP for every endpoint.
Docs Auth
Protect your documentation with basic auth or API key gates for staging environments.
Smart Examples
Auto-generated request and response examples derived from struct tags and validation rules.
From Go structs to OpenAPI in seconds
Declare openswag.Endpoint values with struct tags on the left, get a complete spec on the right.
Three steps to production-ready docs
Define
Build openswag.Endpoint values from your Go request and response structs — no annotations, no codegen.
Mount
Attach the docs handler to your router with one call — Gin, Echo, Fiber, Chi, or net/http.
Serve
Start your app — Scalar UI and the live OpenAPI JSON are served straight from /docs.
Up and running in 30 seconds
Three runtime steps. No CLI to install, no codegen, no generated spec files checked into your repo.