Generates API clients, server stubs and documentation from OpenAPI 2.0 and 3.x documents
open sourceApache-2.0self-hostablefree
Forked from Swagger Codegen in 2018. Founding members felt Swagger Codegen 3.0.0 was diverging too much from the philosophy of 2.x, worried about maintaining two separate 2.x and 3.x branches, and wanted a faster release cycle and a community-owned roadmap (docs/qna.md); forked from Swagger Codegen 2.4.0-SNAPSHOT by more than 40 of its top contributors and template creators
OpenAPI Generator reads an OpenAPI 2.0 or 3.x document and generates API client libraries, server stubs, API documentation and configuration files from Mustache or Handlebars templates. It has generators for dozens of languages and frameworks, among them Ruby, Python, TypeScript, Go, Java, Kotlin, C#, PHP, Rust, Swift, Dart and Elixir clients, and Spring, FastAPI, Go and ASP.NET Core server stubs. Templates can be overridden or replaced to customise the output. It is a community fork of Swagger Codegen, started in 2018 by more than 40 of its top contributors, and runs as a Java CLI, a Maven or Gradle plugin, a Docker image or a self-hosted online generator.
Ways to install
Package managers
Problems it solves
- generate API client libraries in ten languages from our OpenAPI spec
- maintaining hand-written SDKs for Python, Ruby and TypeScript every time the API changes is killing us
- keep our public API clients in sync with the backend automatically in CI
- turn a swagger.yaml file into a typed TypeScript fetch client
- scaffold a Spring Boot or FastAPI server from an API contract we designed first
- our Swagger Codegen setup is stuck on an old version and the project direction changed
- customise the templates of generated client code so it matches our style and naming
- generate HTML or Markdown API reference docs from an OpenAPI document
- produce model classes for every schema in our API spec instead of writing DTOs by hand
- add a Maven or Gradle build step that regenerates the API client on every build
- run a code generator in Docker without installing Java on the build machine
- ship an SDK in a language none of our engineers write, like Elixir or Dart
Features
- API clients for dozens of languages and HTTP libraries
- server stubs (Spring, FastAPI, Flask, Gin, ASP.NET Core and others)
- documentation generators (HTML, Markdown, Asciidoc, PlantUML)
- OpenAPI 2.0 and 3.x input
- customisable Mustache/Handlebars templates
- Maven and Gradle plugins
- CLI via JAR, Homebrew, npm wrapper or pip
- Docker CLI image and self-hosted online generator service
- migration guide from Swagger Codegen
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
| Takes plugins | plan not known |
Alternatives
The same job
These do what OpenAPI Generator does.
- Swagger Codegen Generates API clients, server stubs and documentation from an OpenAPI or Swagger definition
- go-swagger Swagger 2.0 (OpenAPI 2.0) toolkit for Go: generate servers, clients, CLIs and models, or a spec from code
