|
1 | 1 | # <img src="https://raw.githubusercontent.com/swagger-api/swagger.io/wordpress/images/assets/SWC-logo-clr.png" height="80">
|
2 | 2 |
|
| 3 | +[](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3) |
| 4 | + |
| 5 | +- 3.0.0: [](https://travis-ci.org/swagger-api/swagger-codegen) |
| 6 | +[](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3) |
| 7 | +[](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen) |
| 8 | +- Master (2.4.4): [](https://travis-ci.org/swagger-api/swagger-codegen) |
| 9 | +[](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master) |
| 10 | +[](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen) |
| 11 | + |
| 12 | +[](https://maven-badges.herokuapp.com/maven-central/io.swagger.codegen.v3/swagger-codegen-project) |
| 13 | + |
| 14 | +:warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: |
| 15 | + |
| 16 | +## Versioning |
| 17 | + |
| 18 | +**NOTE:** version 2.X (`io.swagger`) and 3.X (`io.swagger.codegen.v3`) have **different** group ids. |
| 19 | + |
| 20 | +2.X and 3.X version lines of Swagger Codegen are available; 2.X ([`master` branch](https://github.com/swagger-api/swagger-codegen/tree/master)) supports Swagger/OpenAPI version 2, |
| 21 | +while 3.X ([`3.0.0` branch](https://github.com/swagger-api/swagger-codegen/tree/3.0.0)) supports OpenAPI version 3 (and version 2 via spec conversion to version 3). |
| 22 | +[Online generator of version 3.X](https://github.com/swagger-api/swagger-codegen/tree/3.0.0#online-generators) supports both generation from Swagger/OpenAPI version 2 (by using engine + generators of 2.X) and version 3 specifications. |
| 23 | + |
| 24 | + |
| 25 | +**NOTE:** this document refers to version 3.X, check [here](https://github.com/swagger-api/swagger-codegen/tree/master) for 2.X. |
| 26 | + |
| 27 | +### Swagger Codegen 3.X ([`3.0.0` branch](https://github.com/swagger-api/swagger-codegen/tree/3.0.0)) |
| 28 | + |
| 29 | +Swagger Codegen 2.X supports OpenAPI version 3 (and version 2 via spec conversion to version 3) |
| 30 | +[Online generator of version 3.X](https://github.com/swagger-api/swagger-codegen/tree/3.0.0#online-generators) supports both generation from Swagger/OpenAPI version 2 (by using engine + generators of 2.X) and version 3 specifications. |
| 31 | + |
| 32 | +group id: `io.swagger.codegen.v3` |
| 33 | +maven central: https://mvnrepository.com/artifact/io.swagger.codegen.v3 |
| 34 | + |
| 35 | +dependency example: |
| 36 | + |
| 37 | +``` |
| 38 | +<dependency> |
| 39 | + <groupId>io.swagger.codegen.v3</groupId> |
| 40 | + <artifactId>swagger-codegen-maven-plugin</artifactId> |
| 41 | + <version>3.0.7</version> |
| 42 | +</dependency> |
| 43 | +``` |
| 44 | + |
| 45 | +### Swagger Codegen 2.X ([`master` branch](https://github.com/swagger-api/swagger-codegen/tree/master)) |
| 46 | + |
| 47 | +Swagger Codegen 2.X supports Swagger/OpenAPI version 2. |
| 48 | + |
| 49 | +group id: `io.swagger` |
| 50 | +maven central (maven plugin): https://mvnrepository.com/artifact/io.swagger/swagger-codegen-maven-plugin |
| 51 | + |
| 52 | +dependency example: |
| 53 | + |
| 54 | +``` |
| 55 | +<dependency> |
| 56 | + <groupId>io.swagger</groupId> |
| 57 | + <artifactId>swagger-codegen-maven-plugin</artifactId> |
| 58 | + <version>2.4.4</version> |
| 59 | +</dependency> |
| 60 | +``` |
| 61 | + |
3 | 62 | ## Overview
|
4 | 63 | This is the Swagger Codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Definition](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported:
|
5 | 64 |
|
@@ -81,12 +140,12 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
|
81 | 140 | If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
82 | 141 |
|
83 | 142 | ```sh
|
84 |
| -wget http://central.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.0/swagger-codegen-cli-3.0.0.jar -O swagger-codegen-cli.jar |
| 143 | +wget http://central.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.7/swagger-codegen-cli-3.0.7.jar -O swagger-codegen-cli.jar |
85 | 144 |
|
86 | 145 | java -jar swagger-codegen-cli.jar --help
|
87 | 146 | ```
|
88 | 147 |
|
89 |
| -For Windows users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. `Invoke-WebRequest -OutFile swagger-codegen-cli.jar http://central.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.0/swagger-codegen-cli-3.0.0.jar` |
| 148 | +For Windows users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. `Invoke-WebRequest -OutFile swagger-codegen-cli.jar http://central.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.7/swagger-codegen-cli-3.0.7.jar` |
90 | 149 |
|
91 | 150 | On a mac, it's even easier with `brew`:
|
92 | 151 | ```sh
|
|
0 commit comments