You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/swagge/codegen/v3/swagger-codegen-cli/3.0.0/swagger-codegen-cli-3.0.0.jar`
76
+
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`
77
77
78
78
On a mac, it's even easier with `brew`:
79
79
```sh
@@ -158,6 +158,7 @@ cd /vagrant
158
158
159
159
##### Swagger Generator Docker Image
160
160
161
+
See also [online generators](#online-generators)
161
162
The Swagger Generator image provides a ready to use web application (swagger-generator) providing code generation services.
162
163
163
164
Image accepts the following env variables:
@@ -180,6 +181,8 @@ or
180
181
181
182
##### Swagger Generator "Minimal" Docker Image
182
183
184
+
See also [online generators](#online-generators)
185
+
183
186
The Swagger Generator "Minimal" image can act as a self-hosted web application and API for generating code.
184
187
185
188
This container can be incorporated into a CI pipeline, and requires some docker orchestration to access generated code.
One can also generate API client or server using the online generators (https://generator3.swagger.io)
654
+
`swagger-generator` module exposes codegen as a web service, with it's own `swagger-js` based web UI, and available docker image `swaggerapi/swagger-generator-v3`
655
+
Such web service is deployed at https://generator3.swagger.io/ui, or it can be easily deployed as docker container.
656
+
657
+
The OpenAPI specification of generator service APIs are available either via UI exposed by web service (e.g. https://generator3.swagger.io/ui), as exposed YAML (https://generator3.swagger.io/openapi.json)
658
+
or in source code repo (https://github.com/swagger-api/swagger-codegen/blob/3.0.0/modules/swagger-generator/src/main/resources/openapi.yaml)
659
+
660
+
Please note that both V2 (for v2 specs) and V3 generators (for v3 and v2 specs converted during generation) are supported, by providing property `codegenVersion` (e.g `"codegenVersion" : "v3"`)
654
661
655
662
For example, to generate a java API client, simply send the following HTTP request using curl:
656
663
```sh
@@ -663,7 +670,7 @@ curl -X POST \
663
670
"lang" : "java"
664
671
},
665
672
"type" : "CLIENT",
666
-
"codegenVersion" : "v3"
673
+
"codegenVersion" : "V3"
667
674
}'
668
675
```
669
676
The response will contain a zipped file containing the generated code.
@@ -680,12 +687,12 @@ To customize the SDK, you can specify language specific options with the follow
680
687
}
681
688
},
682
689
"type" : "CLIENT",
683
-
"codegenVersion" : "v3"
690
+
"codegenVersion" : "V3"
684
691
}
685
692
```
686
693
in which the `options``additionalProperties` for a language can be obtained by submitting a `GET` request to `https://generator3.swagger.io/api/options?language={language}&version={codegenVersion}`:
687
694
688
-
For example, `curlhttps://generator3.swagger.io/api/options?language=java&version=v3` returns (truncated output):
695
+
For example, `curlhttps://generator3.swagger.io/api/options?language=java&version=V3` returns (truncated output):
689
696
690
697
```json
691
698
{
@@ -730,6 +737,28 @@ Instead of using `specURL` with an URL to the OpenAPI/Swagger spec, one can incl
- `HIDDEN_OPTIONS_PATH` (alternative to `HIDDEN_OPTIONS`): useful if attaching a volume containing a `hiddenOptions.yaml` file definining which languages to hide. e.g. `/data/hiddenOptions.yaml`
748
+
- `HIDDEN_OPTIONS` (alternative to `HIDDEN_OPTIONS_PATH`): allows to pass hidden options as an env variable, in the format `{category}:{language},{language},{language}|{category}:{language},{language},{language}`
749
+
e.g. `servers:foo,bar|clientsV3:wtf,isthis` where `category` can be `clients`, `servers`, `clientsV3`, `serversV3`
0 commit comments