OpenAPI Generator
OpenAPI Generator: A Developer’s Guide to Code Generation for REST APIs
OpenAPI Generator is a powerful, community-driven tool that automates the generation of API client libraries (SDKs), server stubs, documentation, and configuration from OpenAPI specifications. Born as a fork of Swagger Codegen, it has grown into a mature project focused on developer experience: making it easier to consume and implement REST APIs across languages, frameworks, and environments. This guide explores what OpenAPI Generator is, how it can help you, and how you can get started today.
Stable releases in Maven Central Apache 2.0 License Open Collective backers Join the Slack chat room Follow OpenAPI Generator Twitter Contribute with Gitpod Conan Center Revved up by Develocity
Overview
OpenAPI Generator allows generation of API client libraries (SDKs), server stubs, documentation, and configuration automatically given an OpenAPI Spec (2.0 and 3.x are supported). It is designed to support a broad ecosystem of languages and frameworks, making it a practical choice for teams that want consistent, generated code across their technology stack.
What you can generate
- API clients (SDKs) in a wide array of languages and ecosystems
- Examples include Java, Kotlin, Python, JavaScript/TypeScript, Go, C#, PHP, Ruby, Rust, Swift, Scala, Haskell, Lua, R, Nim, and more
- Server-side clients and microservice-oriented runtimes are also supported
- Server stubs for rapid API prototyping across languages
- Java, Go, Kotlin, Python, Node.js, PHP, and others
- API documentation artifacts in HTML, Markdown, Confluence, PlantUML, and others
- Configuration files and templates to accelerate build pipelines and project setup
What makes OpenAPI Generator unique
- Community-driven development: the project is guided by real-world needs, with contributors shaping generators for a broad audience
- Wide language coverage: hundreds of generators across API clients, server stubs, and documentation
- Extensibility: templates and customization options allow teams to tailor generated code to their conventions
- Online and containerized options: ready-to-use Docker images, npm wrappers, and online services reduce setup friction
Sponsors and Community Support
OpenAPI Generator relies on the generosity of sponsors and backers to sustain its ongoing development. Bronze sponsors and ecosystem partners help keep the project healthy and accessible to developers around the world. In addition to corporate sponsorships, individual developers can contribute time, code, documentation, and tutorials. The project community often highlights sponsor logos and supporters to recognize their contributions.
- Bronze sponsors logos appear in the sponsor gallery, illustrating a vibrant ecosystem of partners and users
- Acknowledgments extend to GoDaddy for domain names, Linode for VPS hosting, Checkly for API monitoring, and Gradle for development tooling support
Images
- The project’s badge and sponsor visuals appear in banners throughout communications and the project site. These visuals underscore the open-source, collaborative nature of OpenAPI Generator.
Getting Started: Installation and Setup
The OpenAPI Generator project emphasizes a practical path to getting productive quickly. Here is a practical progression from installation to first run.
1 - Installation
1.1 Compatibility
OpenAPI Generator keeps up with the evolving OpenAPI Specification. The project has a history of stable releases and ongoing development:
- 7.23.0 (latest stable release) released 28.04.2026
- 7.24.0 (upcoming minor release) slated for 08.07.2026
- Earlier major lines include 6.6.0 (2023) and 5.4.0 (2022)
- OpenAPI Spec compatibility spans 1.0, 1.1, 1.2, 2.0, 3.0, and 3.1 (beta support) This progression means you can rely on modern OpenAPI features while maintaining compatibility with older specifications when needed.
1.2 Artifacts on Maven Central
Core artifacts and tooling for OpenAPI Generator live on Maven Central:
- Core: org.openapitools:openapi-generator
- CLI: org.openapitools:openapi-generator-cli
- Maven plugin: org.openapitools:openapi-generator-maven-plugin
- Gradle plugin: org.openapitools:openapi-generator-gradle-plugin These artifacts are versioned to align with the OpenAPI Generator releases and can be pulled into Java-based projects via standard Maven/Gradle configurations.
1.3 Download JAR
For a quick start, you can download the latest stable JAR and run it with Java. Example:
- JAR URL: https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.23.0/openapi-generator-cli-7.23.0.jar Mac/Linux:
- wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.23.0/openapi-generator-cli-7.23.0.jar -O openapi-generator-cli.jar Windows: Use Invoke-WebRequest or a downloaded wget equivalent
- Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.23.0/openapi-generator-cli-7.23.0.jar
After download, you can run:
- java -jar openapi-generator-cli.jar help
Tips for Mac users
- Ensure Java 11 is installed and correctly configured (java -version)
- Export JAVA_HOME to point to a Java 11 runtime, for example:
- export JAVAHOME=$(/usr/libexec/javahome -v 1.11)
- export PATH=$JAVA_HOME/bin:$PATH
Launcher Script
Manual JAR downloads require you to keep up to date. A Bash launcher script is provided to automate the process:
- bin/utils/openapi-generator-cli.sh can be fetched and installed to your PATH
- The script checks for the latest release and executes it
- You can pin a particular version by exporting OPENAPIGENERATORVERSION
1.4 Build Projects
If you prefer building from source, you’ll need:
- Java 11
- Apache Maven 3.8.8 or greater (optional, you can use the Maven wrapper)
Typical build steps:
- git clone https://github.com/openapitools/openapi-generator.git
- cd openapi-generator
- ./mvnw clean install (Linux/macOS)
- mvnw.cmd clean install (Windows)
Nix users have a convenient path:
- Enter a shell with Java 11 and Maven via nix develop
- If using direnv, run direnv allow to auto-load the environment
- Build with the static-analysis profile as needed:
- ./mvnw -Pstatic-analysis clean install
1.5 Homebrew macOS users can install via Homebrew:
- brew install openapi-generator
- Example: openapi-generator generate -i [Petstore YAML URL] -g ruby -o /tmp/test/
- To upgrade or switch to master:
- brew uninstall openapi-generator && brew install --HEAD openapi-generator
- Before running, ensure Java and Maven are installed if required
1.6 Docker
Docker provides a portable, self-contained way to use OpenAPI Generator without local Java installs.
Public pre-built Docker images
- Official CLI image: openapitools/openapi-generator-cli
- Official online service: openapitools/openapi-generator-online
Using the CLI container
- docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \ -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -g go -o /local/out/go
- The generated code appears under ./out/go
OpenAPI Generator Online Docker Image
- This image hosts a web service that can generate code via HTTP requests
- Example commands show starting the container, querying an API, and downloading the generated artifact
- The server exposes endpoints such as /api/gen/clients/{language} and a download path
Development in Docker
- A run-in-docker.sh script helps map the repository and the local Maven repository into a container
- It enables commands like mvn package from inside the container and outputs artifacts to /gen/out
- This setup is particularly helpful for contributors and for reproducing builds in a consistent environment
Troubleshooting and Advanced Scenarios
- When encountering test or build issues, running a clean build with -U can resolve several classpath or dependency issues
- If you are working with Docker and encounter integration issues, ensure the container has appropriate network access and that the generation URL is reachable
1.7 NPM
An NPM wrapper exists to provide a convenient CLI in Node.js environments:
- npm install @openapitools/openapi-generator-cli -g
- You can pin or switch versions using a version manager
- The wrapper is particularly popular for developers who prefer Node tooling and want a consistent CLI experience
1.8 pip
A Python package is available to install the CLI via PyPI:
- pip install openapi-generator-cli
- You can specify a version like:
- pip install openapi-generator-cli==7.23.0 Note: This approach requires Java to run the generator; the Python wrapper simply orchestrates the Java-based tool.
Getting Started: The Basics
2 - Getting Started To illustrate the workflow, here is a quick example of generating a PHP client from a Petstore OpenAPI YAML file:
- git clone https://github.com/openapitools/openapi-generator
- cd openapi-generator
- ./mvnw clean package
- java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/30/petstore.yaml \ -g php -o /var/tmp/phpapi_client
You can also download the JAR directly from maven.org:
- https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.23.0/openapi-generator-cli-7.23.0.jar
If you want to see the full set of options for generation, run:
- java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate
3 - Usage
3.1 Customization
Customization.md explains how to tailor the output to your project conventions, including package naming, versioning, and code style preferences. Custom templates allow you to shape the generated code to match your organization’s standards.
3.2 Workflow Integration (Maven, Gradle, Github, CI/CD)
Docs/integration.md covers integrating OpenAPI Generator into your build pipelines and CI/CD workflows. This includes Maven and Gradle plugin usage, as well as automation with GitHub Actions and other CI/CD platforms.
3.3 Online OpenAPI generator
Public online services provide convenient, hosted generation:
- Latest stable: https://api.openapi-generator.tech
- Latest master: https://api-latest-master.openapi-generator.tech Linode sponsors these online services, providing a hosted environment to test and generate code without local setup.
3.4 License information on Generated Code
Generated code is provided AS IS, without warranties, and is owned by the user who generated it. The templates themselves are subject to the project’s license. This distinction ensures users can adopt generated code without inheriting the generator’s license terms for their own code.
3.5 IDE Integration
A variety of IDE plugins help integrate OpenAPI Generator into your development environment:
- Eclipse: Codewind OpenAPI Tools for Eclipse (IBM)
- IntelliJ IDEA: OpenAPI Generator plugin (Jim Schubert)
- IntelliJ IDEA: Senya Editor
- RepreZen API Studio
- Visual Studio: REST API Client Code Generator
- Visual Studio Code: Codewind OpenAPI Tools (IBM)
4 - Companies/Projects Using OpenAPI Generator
OpenAPI Generator is used by a broad spectrum of organizations and projects. The list includes industry leaders and innovative teams across various domains, from web platforms to cloud infrastructure, illustrating the versatility and reliability of generated code in production environments. Prominent names appear in sponsor and case-study sections, reflecting the tool’s adoption in real-world software ecosystems.
5 - Presentations, Videos, Tutorials, Books
The project has inspired a wealth of learning materials, including conference talks, blog posts, and eBooks. Here are representative examples:
- Community talks and tutorials from 2018–2024
- Blog posts about code generation best practices and OpenAPI usage
- Tutorials showing how to connect OpenAPI Generator with popular frameworks like Spring Boot, Angular, and Go
- Books and eBooks focusing on code generation for REST APIs
6 - About Us
6.1 OpenAPI Generator Core Team
The core team comprises contributors who consistently review issues, fix bugs, and implement enhancements. Notable core team members include long-standing contributors who have helped steer the project through numerous releases and community discussions.
Template Creator
Embedded Mustache templates power many generators, enabling consistent code generation across languages. The template creators cover a wide range of languages and server stubs, including Ada, Apex, Bash, C, C++, C#, Java, Kotlin, Python, Ruby, Rust, TypeScript, and more.
6.2 OpenAPI Generator Technical Committee
The Technical Committee provides guidance, reviews substantial changes, and helps set the project’s technical direction. Eligibility typically requires significant contribution (e.g., multiple merged PRs) and a demonstrated track record of constructive involvement. To express interest, contributors can reach out via [email protected].
Members of the Technical Committee include representatives for ActionScript, Ada, Bash, Java, Java Spring, Go, Kotlin, TypeScript, Python, and many other generator communities. The committee’s purpose is to ensure quality, compatibility, and forward momentum across the diverse set of generators.
6.3 History of OpenAPI Generator
OpenAPI Generator is a community-driven fork of Swagger Codegen. Following disagreements about direction, more than 40 top Swagger Codegen contributors and template creators joined the fork to form OpenAPI Generator. This history highlights a commitment to collaboration and maintaining a robust, community-led ecosystem.
Founding Members (alphabetical)
- Akihito Nakano
- Artem Ocheredko
- Arthur Mogliev
- Bartek Kryza
- Ben Wells
- Benjamin Gill
- Christophe Bornet
- Cliffano Subagio
- Daiki Matsudate
- Daniel
- Emiliano Bonassi
- Erik Timmers
- Esteban Gehring
- Gustavo Paz
- Javier Velilla
- Jean-François Côté
- Jim Schubert
- Jon Schoning
- Jérémie Bresson
- Jörn Ahrens
- Keni Steward
- Marcin Stefaniuk
- Martin Delille
- Masahiro Yamauchi
- Michele Albano
- Ramzi Maalej
- Ravindra Nikam
- Ricardo Cardona
- Sebastian Haas
- Sebastian Mandrean
- Sreenidhi Sreesha
- Stefan Krismann
- Stephane Carrez
- Takuro Wada
- Tomasz Prus
- Tristan Sloughter
- Victor Orlovsky
- Victor Trakhtenberg
- Vlad Frolov
- Vladimir Pouzanov
- William Cheng
- Xin Meng
- Xu Hui Hui
- antihax
- beatcracker
- daurnimator
- etherealjoy
- jfiala
- lukoyanov
7 - License
OpenAPI Generator is licensed under the Apache License, Version 2.0. The license text is available at apache.org/licenses/LICENSE-2.0. The code and templates are provided under this license, ensuring broad usability and permissive terms for developers and organizations. The project maintains transparency about licensing, and generated code is typically considered AS IS, with licensing terms determined by the code’s author or the consuming project.
Images and Visuals Throughout
- The post features visual badges and sponsor logos that echo the original project’s branding and community support. While the technical content stands on its own, the visuals underscore the collaborative spirit and the breadth of the ecosystem.
Conclusion: Why OpenAPI Generator Matters for Modern API Development
OpenAPI Generator is more than a tool; it is a catalyst for consistent, scalable API development. By enabling automated generation of clients, servers, and documentation from OpenAPI specifications, it reduces boilerplate, accelerates integration work, and helps teams maintain coherence across languages and platforms. Its open-source nature, combined with a robust community and company-sponsored ecosystem, makes it a practical choice for organizations pursuing API-first strategies and rapid iteration.
If you’re exploring API development, consider starting with a small OpenAPI specification and a generated client in a language your team uses daily. Experiment with the CLI, try a Docker-based workflow, and explore the online generator for quick feedback. As you grow more comfortable, you can tailor the templates to your code conventions, integrate with your build pipeline, and contribute improvements back to the community. OpenAPI Generator is designed to be as approachable as it is powerful, making code generation a practical, repeatable, and valuable part of modern software development.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/OpenAPITools/openapi-generator
GitHub - OpenAPITools/openapi-generator: OpenAPI Generator
OpenAPI Generator is a powerful, community-driven tool that automates the generation of API client libraries (SDKs), server stubs, documentation, and configurat...
github - openapitools/openapi-generator
Maintain OpenAPI Generator? Add the badge to your README
Show that the project is featured on TechLogHub and send readers to this write-up.
[](https://techloghub.com/open-source/openapi-generator?utm_source=techloghub_badge&utm_medium=referral&utm_campaign=readme)
