OpenAPI Generator reads OpenAPI 2.x and 3.x specs and emits client SDKs, server stubs, documentation, and related artifacts across many languages. It runs as a CLI, with Maven or Gradle plugins, npm wrapper, or Docker.
Overview
The tool takes a machine-readable API description and produces language-specific clients, server scaffolds, HTML or wiki documentation, Postman collections, GraphQL, JMeter tests, and schema helpers. Generator templates are Mustache-based and can be replaced or extended for custom output.
Installation paths include JAR download, Homebrew, npm package wrapper, pip, and pre-built Docker images for CLI use. A separate online Docker image exposes a self-hosted web application and HTTP API for generation, which can fit into CI pipelines. Workflow integrations cover Maven, Gradle, Bazel, SBT, Cake, and hosted generator SaaS offerings.
Supported client targets span mainstream languages and HTTP stacks, while server generators cover dozens of backends. Documentation generators include HTML, Confluence, AsciiDoc, Markdown, and PlantUML. Options and classpath plugins allow further customization beyond default templates.
The project grew from the Swagger Codegen lineage and documents a migration guide from that tool. Spec compatibility spans OpenAPI 1.x through 3.1 beta.
Key features
- 50+ API client generators
- 40+ server stub generators
- OpenAPI 2.0 and 3.x input
- Custom Mustache templates
- Maven and Gradle plugins
- CLI via npm or Homebrew
- Docker CLI and online images
- Docs and config generators
Use cases
- Publishing SDKs from an API spec
- Bootstrapping server projects
- Generating static API documentation
- CI code generation pipelines
- MySQL or GraphQL schema export