|
2 | 2 |
|
3 | 3 | [](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-core-master-java-8)
|
4 | 4 |
|
5 |
| -- Master (2.4.1): [](https://travis-ci.org/swagger-api/swagger-codegen) |
| 5 | +- Master (2.4.4): [](https://travis-ci.org/swagger-api/swagger-codegen) |
6 | 6 | [](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master)
|
7 | 7 | [](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen)
|
8 | 8 | - 3.0.0: [](https://travis-ci.org/swagger-api/swagger-codegen)
|
9 | 9 | [](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3)
|
10 | 10 | [](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen)
|
11 | 11 |
|
12 | 12 |
|
13 |
| -[](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) |
14 |
| -[](http://issuestats.com/github/swagger-api/swagger-codegen) [](http://issuestats.com/github/swagger-api/swagger-codegen) |
| 13 | +[Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) |
15 | 14 |
|
16 | 15 | :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).:star::star::star:
|
17 | 16 |
|
|
23 | 22 |
|
24 | 23 | :notebook_with_decorative_cover: The eBook [A Beginner's Guide to Code Generation for REST APIs](https://gumroad.com/l/swagger_codegen_beginner) is a good starting point for beginners.
|
25 | 24 |
|
| 25 | +## Versioning |
| 26 | + |
| 27 | +**NOTE:** version 2.X (`io.swagger`) and 3.X (`io.swagger.codegen.v3`) have **different** group ids. |
| 28 | + |
| 29 | +2.X and 3.X version lines of Swagger Codegen are available; 2.X (`master` branch) supports Swagger/OpenAPI version 2, |
| 30 | +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). |
| 31 | +[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. |
| 32 | + |
| 33 | + |
| 34 | +**NOTE:** this document refers to version 2.X, check [here](https://github.com/swagger-api/swagger-codegen/tree/3.0.0) for 3.X. |
| 35 | + |
| 36 | + |
| 37 | +### Swagger Codegen 2.X ([`master` branch](https://github.com/swagger-api/swagger-codegen/tree/master)) |
| 38 | + |
| 39 | +Swagger Codegen 2.X supports Swagger/OpenAPI version 2. |
| 40 | + |
| 41 | +group id: `io.swagger` |
| 42 | +maven central (maven plugin): https://mvnrepository.com/artifact/io.swagger/swagger-codegen-maven-plugin |
| 43 | + |
| 44 | +dependency example: |
| 45 | + |
| 46 | +``` |
| 47 | +<dependency> |
| 48 | + <groupId>io.swagger</groupId> |
| 49 | + <artifactId>swagger-codegen-maven-plugin</artifactId> |
| 50 | + <version>2.4.4</version> |
| 51 | +</dependency> |
| 52 | +``` |
| 53 | + |
| 54 | +### Swagger Codegen 3.X ([`3.0.0` branch](https://github.com/swagger-api/swagger-codegen/tree/3.0.0)) |
| 55 | + |
| 56 | +Swagger Codegen 2.X supports OpenAPI version 3 (and version 2 via spec conversion to version 3) |
| 57 | +[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. |
| 58 | + |
| 59 | +group id: `io.swagger.codegen.v3` |
| 60 | +maven central: https://mvnrepository.com/artifact/io.swagger.codegen.v3 |
| 61 | + |
| 62 | +dependency example: |
| 63 | + |
| 64 | +``` |
| 65 | +<dependency> |
| 66 | + <groupId>io.swagger.codegen.v3</groupId> |
| 67 | + <artifactId>swagger-codegen-maven-plugin</artifactId> |
| 68 | + <version>3.0.7</version> |
| 69 | +</dependency> |
| 70 | +``` |
| 71 | + |
| 72 | + |
| 73 | + |
26 | 74 | ## Overview
|
27 | 75 | This is the Swagger Codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported:
|
28 | 76 |
|
@@ -109,12 +157,12 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
|
109 | 157 | If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum):
|
110 | 158 |
|
111 | 159 | ```sh
|
112 |
| -wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar -O swagger-codegen-cli.jar |
| 160 | +wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.4/swagger-codegen-cli-2.4.4.jar -O swagger-codegen-cli.jar |
113 | 161 |
|
114 | 162 | java -jar swagger-codegen-cli.jar help
|
115 | 163 | ```
|
116 | 164 |
|
117 |
| -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/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar` |
| 165 | +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/swagger-codegen-cli/2.4.4/swagger-codegen-cli-2.4.4.jar` |
118 | 166 |
|
119 | 167 | On a mac, it's even easier with `brew`:
|
120 | 168 | ```sh
|
@@ -259,7 +307,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
|
259 | 307 | ```
|
260 | 308 | (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`)
|
261 | 309 |
|
262 |
| -You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar) |
| 310 | +You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.4/swagger-codegen-cli-2.4.4.jar) |
263 | 311 |
|
264 | 312 | To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate`
|
265 | 313 |
|
|
0 commit comments