swagger-api /swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.

★ 17,800⑂ 5,933👁 403⑃ 5,846● 6,583▤ 157
MustacheApache-2.0Created 2011-07-06swagger.io
下载:v3.0.85v3.0.85 ↓3.0.852026-11-04
+2
日增长
17,800
stars
5,933
forks
403
watchers
5,846
prs
6,583
issues
157
releases

README

Swagger Codegen
!Swagger Codegen Logo

This is the Swagger Codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec.

💚 If you would like to contribute, please refer to guidelines and a list of open tasks.💚

📔 For more information, please refer to the Wiki page and FAQ 📔

⚠️ If the OpenAPI Description or Swagger file is obtained from an untrusted source, please make sure you've reviewed the artefact before using Swagger Codegen to generate the API client, server stub or documentation as code injection may occur. ⚠️

 Versioning

 ⚠️ this document refers to version 2.X, check here for 3.X.

Both 2.X and 3.X version lines of Swagger Codegen are available and are independently maintained.

NOTES:

- Versions 2.X (io.swagger) and 3.X (io.swagger.codegen.v3) have different group ids.
- OpenAPI 3.0.X is supported from the 3.X version only.

For full versioning information, please refer to the versioning documentation.

 Supported Languages and Frameworks

Currently, the following languages/frameworks are supported:

- API clients: ActionScript, Ada, Apex, Bash, C (.net 2.0, 3.5 or later), C++ (cpprest, Qt5, Tizen), Clojure, Dart, Elixir, Elm, Eiffel, Erlang, Go, Groovy, Haskell (http-client, Servant), Java (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured), Kotlin, Lua, Node.js (ES5, ES6, AngularJS with Google Closure Compiler annotations) Objective-C, Perl, PHP, PowerShell, Python, R, Ruby, Rust (rust, rust-server), Scala (akka, http4s, swagger-async-httpclient), Swift (2.x, 3.x, 4.x, 5.x), Typescript (Angular1.x, Angular2.x, Fetch, jQuery, Node)
- Server stubs: Ada, C (ASP.NET Core, NancyFx), C++ (Pistache, Restbed), Erlang, Go, Haskell (Servant), Java (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, PKMST), Kotlin, PHP (Lumen, Slim, Silex, Symfony, Zend Expressive), Python (Flask), NodeJS, Ruby (Sinatra, Rails5), Rust (rust-server), Scala (Finch, Lagom, Scalatra)
- API documentation generators: HTML, Confluence Wiki
- Configuration files: Apache2
- Others: JMeter

Check out OpenAPI-Spec for additional information about the OpenAPI project.

 Table of contents

- Versioning
- Compatibility
- Getting Started
- Generators
  - To generate a sample client library
  - Generating libraries from your server
  - Validating your OpenAPI Spec
  - Generating dynamic html api documentation
  - Generating static html api documentation
- Workflow Integration
- Online Generators
- Contribution
- Swagger Codegen Core Team


 Compatibility

The OpenAPI Specification has undergone 3 revisions since initial creation in 2010.  The current stable versions of Swagger Codegen project have the following compatibilities with the OpenAPI Specification:

Swagger Codegen Version    | Release Date | Swagger / OpenAPI Spec compatibility | Notes
--------------------

Top issues

Discussions

Latest release

v3.0.85 v3.0.85 2026-11-04
Swagger Codegen v3.0.85

 What's Changed

 bump snapshot 3.0.85-SNAPSHOT (12780)

Full Changelog: v3.0.84...v3.0.85

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON