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
TA的项目
+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
#4758[Gradle] plugin and sample task that generates code as part of the build process60 comments · 2017-02-08#6520[R] Issues with R Codegen Clients 43 comments · 2017-09-19#4819Javascript client produces a wrong object for a string enum type that is used with $ref39 comments · 2017-02-17#1889Client csharp: Use System.Net.Http.HttpClient instead of RestSharp38 comments · 2016-01-14#2549Client-generation: Allow data validation on the client side (using minLength/maxLength)36 comments · 2016-04-11#2093[Swift] responses: schema: type: object --> RequestBuilder<Inline_response_200> ?31 comments · 2016-02-10#8194[Question] Can Swagger generate custom generic types?30 comments · 2018-05-16#4805[Java] Elision of underscore characters in property names leads to invalid Java30 comments · 2017-02-15
Discussions
#12747Discussion: The role and value of Swagger Codegen in the age of AI / LLMs0 comments · 2026-05-24#12612Online-Generator Help0 comments · 2025-09-22#12586swagger-codegen 3.0.71 generates illegal code for Java 210 comments · 2025-07-21#12534What is the difference between "csharp" and "csharp-dotnet2" for generating C# code?0 comments · 2025-03-27#12522How do I combine multiple OpenAPI specifications into one?2 comments · 2025-02-13#12513Default handling for discriminators with undefined mapping0 comments · 2025-01-07#12499Exploring AutoAPI: An Automation Tool to Simplify Frontend Development0 comments · 2024-12-04#12490If swagger codegen has the function to generate UT autoly?0 comments · 2024-11-08
Latest release
v3.0.85 v3.0.85 2026-11-04Swagger Codegen v3.0.85 What's Changed bump snapshot 3.0.85-SNAPSHOT (12780) Full Changelog: v3.0.84...v3.0.85