Show HN: Go-respec – Generate OpenAPI specs from Go code, no annotations needed
I built go-respec to solve a long-standing annoyance with OpenAPI tooling in Go — the overwhelming reliance on magic comments and boilerplate. If you’ve used swaggo, oapi-codegen, or similar tools, you probably know the pain.
go-respec takes a different approach:
- No annotations - No code generation - No wrappers
It statically analyzes your Go source and infers a full OpenAPI v3 spec — routes, request/response bodies, parameters, middleware, even security — and gives you clean override options when needed. It’s framework-agnostic (works with chi, gin, echo, etc.) and doesn’t care what architecture you use.
You can get a working spec in seconds:
go install github.com/Zachacious/go-respec/cmd/respec@latest
respec . -o openapi.yaml
I built this for my own projects after being frustrated with the existing ecosystem, but it’s already proven useful beyond just my use case.Would love your thoughts, critiques, or feature requests.
Repo: https://github.com/Zachacious/go-respec Docs: https://github.com/Zachacious/go-respec#readme
No comments yet