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
Declare Bearer, Basic, API Key and Cookie schemes once in Config.Auth; readers try them in the Scalar auth playground.
Try-It Console
Readers send live requests from the Scalar UI, with request history and code snippets for every operation — nothing to configure.
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
Any Scalar theme, dark mode, a pinned Scalar version and your own CSS through UIConfig.
Code Snippets
Scalar renders ready-to-use curl, JavaScript, Go, Python and other snippets for every endpoint.
Docs Auth
Protect your documentation with basic auth or API key gates for staging environments.
Schema Components
Named structs become reusable components.schemas with $ref, recursive types self-reference, and pointers are OpenAPI 3.1 nullable types.
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.