6
6
7
7
[ ![ Build Status] ( https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master-java7/badge/icon?subject=jenkins%20build%20-%20java%207 )] ( https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master-java7/ )
8
8
9
- - Master (2.4.15 -SNAPSHOT): [ ![ Build Status] ( https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test )] ( https://travis-ci.org/swagger-api/swagger-codegen )
9
+ - Master (2.4.16 -SNAPSHOT): [ ![ Build Status] ( https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test )] ( https://travis-ci.org/swagger-api/swagger-codegen )
10
10
[ ![ Java Test] ( https://img.shields.io/jenkins/build.svg?jobUrl=https://jenkins.swagger.io/job/oss-swagger-codegen-master )] ( https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master )
11
11
[ ![ Windows Test] ( https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails )] ( https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen )
12
12
13
- - 3.0.21 -SNAPSHOT: [ ![ Build Status] ( https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test )] ( https://travis-ci.org/swagger-api/swagger-codegen )
13
+ - 3.0.22 -SNAPSHOT: [ ![ Build Status] ( https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test )] ( https://travis-ci.org/swagger-api/swagger-codegen )
14
14
[ ![ Java Test] ( https://img.shields.io/jenkins/build.svg?jobUrl=https://jenkins.swagger.io/job/oss-swagger-codegen-3 )] ( https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3 )
15
15
[ ![ Windows Test] ( https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=3.0.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails )] ( https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen )
16
16
@@ -52,7 +52,7 @@ dependency example:
52
52
<dependency>
53
53
<groupId>io.swagger</groupId>
54
54
<artifactId>swagger-codegen-maven-plugin</artifactId>
55
- <version>2.4.14 </version>
55
+ <version>2.4.15 </version>
56
56
</dependency>
57
57
```
58
58
@@ -70,7 +70,7 @@ dependency example:
70
70
<dependency>
71
71
<groupId>io.swagger.codegen.v3</groupId>
72
72
<artifactId>swagger-codegen-maven-plugin</artifactId>
73
- <version>3.0.20 </version>
73
+ <version>3.0.21 </version>
74
74
</dependency>
75
75
```
76
76
@@ -89,7 +89,7 @@ Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for addit
89
89
90
90
# Table of contents
91
91
92
- - [ Swagger Code Generator ] ( #swagger-code-generator )
92
+ - [ Versioning ] ( #versioning )
93
93
- [ Overview] ( #overview )
94
94
- [ Table of Contents] ( #table-of-contents )
95
95
- Installation
@@ -134,8 +134,9 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
134
134
135
135
Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
136
136
-------------------------- | ------------ | -------------------------- | -----
137
- 3.0.21-SNAPSHOT (current 3.0.0, upcoming minor release) [ SNAPSHOT] ( https://oss.sonatype.org/content/repositories/snapshots/io/swagger/codegen/v3/swagger-codegen-cli/3.0.21-SNAPSHOT/ ) | TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release
138
- [ 3.0.20] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.20 ) (** current stable** ) | 2020-05-18 | 1.0, 1.1, 1.2, 2.0, 3.0 | [ tag v3.0.20] ( https://github.com/swagger-api/swagger-codegen/tree/v3.0.20 )
137
+ 3.0.22-SNAPSHOT (current 3.0.0, upcoming minor release) [ SNAPSHOT] ( https://oss.sonatype.org/content/repositories/snapshots/io/swagger/codegen/v3/swagger-codegen-cli/3.0.22-SNAPSHOT/ ) | TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release
138
+ [ 3.0.21] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.21 ) (** current stable** ) | 2020-07-28 | 1.0, 1.1, 1.2, 2.0, 3.0 | [ tag v3.0.21] ( https://github.com/swagger-api/swagger-codegen/tree/v3.0.21 )
139
+ [ 3.0.20] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.20 ) | 2020-05-18 | 1.0, 1.1, 1.2, 2.0, 3.0 | [ tag v3.0.20] ( https://github.com/swagger-api/swagger-codegen/tree/v3.0.20 )
139
140
[ 3.0.19] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.19 ) | 2020-04-02 | 1.0, 1.1, 1.2, 2.0, 3.0 | [ tag v3.0.19] ( https://github.com/swagger-api/swagger-codegen/tree/v3.0.19 )
140
141
[ 3.0.18] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.18 ) | 2020-02-26 | 1.0, 1.1, 1.2, 2.0, 3.0 | [ tag v3.0.18] ( https://github.com/swagger-api/swagger-codegen/tree/v3.0.18 )
141
142
[ 3.0.17] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.17 ) | 2020-02-23 | 1.0, 1.1, 1.2, 2.0, 3.0 | [ tag v3.0.17] ( https://github.com/swagger-api/swagger-codegen/tree/v3.0.17 )
@@ -155,8 +156,9 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
155
156
[ 3.0.2] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.2 ) | 2018-10-19 | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release
156
157
[ 3.0.1] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.1 ) | 2018-10-05 | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes
157
158
[ 3.0.0] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.0 ) | 2018-09-06 | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes
158
- 2.4.15-SNAPSHOT (current master, upcoming minor release) [ SNAPSHOT] ( https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.15-SNAPSHOT/ ) | TBD | 1.0, 1.1, 1.2, 2.0 | Minor release
159
- [ 2.4.14] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.14 ) (** current stable** ) | 2020-05-18 | 1.0, 1.1, 1.2, 2.0 | [ tag v2.4.14] ( https://github.com/swagger-api/swagger-codegen/tree/v2.4.14 )
159
+ 2.4.16-SNAPSHOT (current master, upcoming minor release) [ SNAPSHOT] ( https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.16-SNAPSHOT/ ) | TBD | 1.0, 1.1, 1.2, 2.0 | Minor release
160
+ [ 2.4.15] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.15 ) (** current stable** ) | 2020-07-28 | 1.0, 1.1, 1.2, 2.0 | [ tag v2.4.15] ( https://github.com/swagger-api/swagger-codegen/tree/v2.4.15 )
161
+ [ 2.4.14] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.14 ) | 2020-05-18 | 1.0, 1.1, 1.2, 2.0 | [ tag v2.4.14] ( https://github.com/swagger-api/swagger-codegen/tree/v2.4.14 )
160
162
[ 2.4.13] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.13 ) | 2020-04-02 | 1.0, 1.1, 1.2, 2.0 | [ tag v2.4.13] ( https://github.com/swagger-api/swagger-codegen/tree/v2.4.13 )
161
163
[ 2.4.12] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.12 ) | 2020-01-15 | 1.0, 1.1, 1.2, 2.0 | [ tag v2.4.12] ( https://github.com/swagger-api/swagger-codegen/tree/v2.4.12 )
162
164
[ 2.4.11] ( https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.11 ) | 2020-01-03 | 1.0, 1.1, 1.2, 2.0 | [ tag v2.4.11] ( https://github.com/swagger-api/swagger-codegen/tree/v2.4.11 )
@@ -184,15 +186,17 @@ If you're looking for the latest stable version, you can grab it directly from M
184
186
185
187
``` sh
186
188
# Download current stable 2.x.x branch (Swagger and OpenAPI version 2)
187
- wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.14/swagger-codegen-cli-2.4.14.jar -O swagger-codegen-cli.jar
189
+ wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15/swagger-codegen-cli-2.4.15.jar -O swagger-codegen-cli.jar
190
+
191
+ java -jar swagger-codegen-cli.jar help
188
192
189
193
# Download current stable 3.x.x branch (OpenAPI version 3)
190
- wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.20 /swagger-codegen-cli-3.0.20 .jar -O swagger-codegen-cli.jar
194
+ wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.21 /swagger-codegen-cli-3.0.21 .jar -O swagger-codegen-cli.jar
191
195
192
- java -jar swagger-codegen-cli.jar help
196
+ java -jar swagger-codegen-cli.jar -- help
193
197
```
194
198
195
- 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 https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.14 /swagger-codegen-cli-2.4.14 .jar `
199
+ 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 https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15 /swagger-codegen-cli-2.4.15 .jar `
196
200
197
201
On a mac, it's even easier with ` brew ` :
198
202
``` sh
@@ -232,7 +236,7 @@ To install, run `brew install swagger-codegen`
232
236
233
237
Here is an example usage:
234
238
``` sh
235
- swagger-codegen generate -i http ://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/
239
+ swagger-codegen generate -i https ://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/
236
240
```
237
241
238
242
### Docker
@@ -297,7 +301,7 @@ sleep 5
297
301
GEN_IP=$( docker inspect --format ' {{.NetworkSettings.IPAddress}}' $CID )
298
302
# Execute an HTTP request and store the download link
299
303
RESULT=$( curl -X POST --header ' Content-Type: application/json' --header ' Accept: application/json' -d ' {
300
- "swaggerUrl": "http ://petstore.swagger.io/v2/swagger.json"
304
+ "swaggerUrl": "https ://petstore.swagger.io/v2/swagger.json"
301
305
}' ' http://localhost:8188/api/gen/clients/javascript' | jq ' .link' | tr -d ' "' )
302
306
# Download the generated zip and redirect to a file
303
307
curl $RESULT > result.zip
@@ -317,7 +321,7 @@ Example:
317
321
318
322
``` sh
319
323
docker run --rm -v ${PWD} :/local swaggerapi/swagger-codegen-cli generate \
320
- -i http ://petstore.swagger.io/v2/swagger.json \
324
+ -i https ://petstore.swagger.io/v2/swagger.json \
321
325
-l go \
322
326
-o /local/out/go
323
327
```
@@ -328,28 +332,28 @@ The generated code will be located under `./out/go` in the current directory.
328
332
329
333
## Getting Started
330
334
331
- To generate a PHP client for http ://petstore.swagger.io/v2/swagger.json , please run the following
335
+ To generate a PHP client for https ://petstore.swagger.io/v2/swagger.json , please run the following
332
336
``` sh
333
337
git clone https://github.com/swagger-api/swagger-codegen
334
338
cd swagger-codegen
335
339
mvn clean package
336
340
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
337
- -i http ://petstore.swagger.io/v2/swagger.json \
341
+ -i https ://petstore.swagger.io/v2/swagger.json \
338
342
-l php \
339
343
-o /var/tmp/php_api_client
340
344
```
341
- (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 ` )
345
+ (if you're on Windows, replace the last command with ` java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https ://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client ` )
342
346
343
- You can also download the JAR (latest release) directly from [ maven.org] ( https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.14 /swagger-codegen-cli-2.4.14 .jar )
347
+ You can also download the JAR (latest release) directly from [ maven.org] ( https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15 /swagger-codegen-cli-2.4.15 .jar )
344
348
345
- To get a list of ** general** options available, please run ` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate `
349
+ To get a list of ** general** options available, please run ` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate ` (for version 3.x check [ 3.0.0 branch ] ( https://github.com/swagger-api/swagger-codegen/tree/3.0.0 ) )
346
350
347
351
To get a list of PHP specified options (which can be passed to the generator with a config file via the ` -c ` option), please run ` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php `
348
352
349
353
## Generators
350
354
351
355
### To generate a sample client library
352
- You can build a client against the swagger sample [ petstore] ( http ://petstore.swagger.io) API as follows:
356
+ You can build a client against the swagger sample [ petstore] ( https ://petstore.swagger.io) API as follows:
353
357
354
358
``` sh
355
359
./bin/java-petstore.sh
@@ -361,7 +365,7 @@ This will run the generator with this command:
361
365
362
366
``` sh
363
367
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
364
- -i http ://petstore.swagger.io/v2/swagger.json \
368
+ -i https ://petstore.swagger.io/v2/swagger.json \
365
369
-l java \
366
370
-o samples/client/petstore/java
367
371
```
@@ -459,7 +463,7 @@ Note the `myClientCodegen` is an option now, and you can use the usual arguments
459
463
``` sh
460
464
java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \
461
465
io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\
462
- -i http ://petstore.swagger.io/v2/swagger.json \
466
+ -i https ://petstore.swagger.io/v2/swagger.json \
463
467
-o myClient
464
468
```
465
469
@@ -591,7 +595,7 @@ Each of these files creates reasonable defaults so you can get running quickly.
591
595
592
596
``` sh
593
597
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
594
- -i http ://petstore.swagger.io/v2/swagger.json \
598
+ -i https ://petstore.swagger.io/v2/swagger.json \
595
599
-l java \
596
600
-o samples/client/petstore/java \
597
601
-c path/to/config.json
695
699
696
700
You have options. The easiest is to use our [ online validator] ( https://github.com/swagger-api/validator-badge ) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example:
697
701
698
- http://online.swagger.io/validator/debug?url=http ://petstore.swagger.io/v2/swagger.json
702
+ http://online.swagger.io/validator/debug?url=https ://petstore.swagger.io/v2/swagger.json
699
703
700
704
### Generating dynamic html api documentation
701
705
@@ -771,15 +775,15 @@ One can also generate API client or server using the online generators (https://
771
775
772
776
For example, to generate Ruby API client, simply send the following HTTP request using curl:
773
777
``` sh
774
- curl -X POST -H " content-type:application/json" -d ' {"swaggerUrl":"http ://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby
778
+ curl -X POST -H " content-type:application/json" -d ' {"swaggerUrl":"https ://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby
775
779
```
776
780
Then you will receive a JSON response with the URL to download the zipped code.
777
781
778
782
To customize the SDK, you can ` POST ` to ` https://generator.swagger.io/gen/clients/{language} ` with the following HTTP body:
779
783
``` json
780
784
{
781
785
"options" : {},
782
- "swaggerUrl" : " http ://petstore.swagger.io/v2/swagger.json"
786
+ "swaggerUrl" : " https ://petstore.swagger.io/v2/swagger.json"
783
787
}
784
788
```
785
789
in which the ` options ` for a language can be obtained by submitting a ` GET ` request to ` https://generator.swagger.io/api/gen/clients/{language} ` :
@@ -813,12 +817,12 @@ To set package name to `pet_store`, the HTTP body of the request is as follows:
813
817
"options" : {
814
818
"packageName" : " pet_store"
815
819
},
816
- "swaggerUrl" : " http ://petstore.swagger.io/v2/swagger.json"
820
+ "swaggerUrl" : " https ://petstore.swagger.io/v2/swagger.json"
817
821
}
818
822
```
819
823
and here is the curl command:
820
824
``` sh
821
- curl -H " Content-type: application/json" -X POST -d ' {"options": {"packageName": "pet_store"},"swaggerUrl": "http ://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python
825
+ curl -H " Content-type: application/json" -X POST -d ' {"options": {"packageName": "pet_store"},"swaggerUrl": "https ://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python
822
826
```
823
827
824
828
Instead of using ` swaggerUrl ` with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with ` spec ` , e.g.
@@ -982,6 +986,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
982
986
- [ Trexle] ( https://trexle.com/ )
983
987
- [ Upwork] ( http://upwork.com/ )
984
988
- [ uShip] ( https://www.uship.com/ )
989
+ - [ Variograma] ( https://variograma.pt )
985
990
- [ VMware] ( https://vmware.com/ )
986
991
- [ Viavi Solutions Inc.] ( https://www.viavisolutions.com )
987
992
- [ W.UP] ( http://wup.hu/?siteLang=en )
0 commit comments