#1717th of 45 in Backend and cloud templates
oapi-codegen
Go code generator that turns OpenAPI specs into servers, clients and types
- Stars
- 8.7k
- License
- Apache-2.0
- Last commit
- Nov 2026
- Last release
- Oct 2026
- Language
- Go
8,182 on 21 Apr 20268,655 on 10 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
oapi-codegen is a Go command-line tool and library that reads OpenAPI 3.0 and 3.1 specs and generates Go server interfaces, API clients, or plain HTTP models. It is configured through a YAML file and typically run via go:generate. It has no AI features, so it fits this list only loosely as backend scaffolding.
Who it is for: Go developers building or consuming OpenAPI-defined HTTP APIs
Strengths
- Generates server stubs for several Go frameworks, including net/http, plus clients and models
- Optional strict server mode handles request and response marshalling for you
- Supports OpenAPI 3.0 and 3.1, including webhooks and the 3.2 QUERY method
- Generated code comes from text/templates you can override
Weaknesses
- No OpenAPI 2.0 (Swagger) support; specs must be converted first
- Template overrides and importing pkg/ are explicitly unstable across releases
- Building the tool requires Go 1.26+
- No defined release cadence; README recommends pinning to commits for unreleased fixes
What it needs
- Go
- Needs Go 1.26+
Quick answers
Is oapi-codegen open source?
Yes. Its code is on GitHub under the Apache-2.0 license.
Also in Backend and cloud templates
See all 45| Rank | Project | Score |
|---|---|---|
| 1 | fastapiPython web framework for typed REST APIs with automatic OpenAPI docs | 90 out of 100 |
| 2 | fiberExpress-style HTTP web framework for Go, built on fasthttp | 90 out of 100 |
| 3 | generator-jhipsterCode generator for Java apps with Angular, React or Vue frontends | 90 out of 100 |
| #4 | serverlessCLI that deploys AWS Lambda code and infrastructure from serverless.yml | 88 out of 100 |
| #5 | echoMinimalist Go web framework with a radix-tree router and middleware | 86 out of 100 |