mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-27 16:47:06 +00:00
Compare commits
163 Commits
swift5-cod
...
java_fix_e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a049e4c271 | ||
|
|
eee7a40629 | ||
|
|
a5ab60bec8 | ||
|
|
e086ad1b6e | ||
|
|
1a6d3671d9 | ||
|
|
589e5c6312 | ||
|
|
024f46814c | ||
|
|
1ce09788a9 | ||
|
|
44fda895d2 | ||
|
|
aa4ead2a6d | ||
|
|
7e8c7db798 | ||
|
|
b83fe0c611 | ||
|
|
5182955cca | ||
|
|
cd9eea2fe5 | ||
|
|
ef88bd175f | ||
|
|
99fcfbc802 | ||
|
|
a4811c7850 | ||
|
|
2ada4d90b4 | ||
|
|
dac370b7f7 | ||
|
|
6f7d2792c7 | ||
|
|
2d7785ac63 | ||
|
|
eb6ca9199b | ||
|
|
c3535cf9ca | ||
|
|
286cdfdfa2 | ||
|
|
55786119e7 | ||
|
|
94d4e0cfac | ||
|
|
99d85a39a3 | ||
|
|
b936d72dfa | ||
|
|
93aedcf3d5 | ||
|
|
d04e16a255 | ||
|
|
fae0528cd5 | ||
|
|
ba65f675e2 | ||
|
|
5e27f11ef1 | ||
|
|
850c493c63 | ||
|
|
f5327b601e | ||
|
|
123efc5d65 | ||
|
|
36ccd87a80 | ||
|
|
20db89e277 | ||
|
|
a5349cfde5 | ||
|
|
4a92cd8dca | ||
|
|
c8a65a9942 | ||
|
|
4b6499c636 | ||
|
|
290550ef91 | ||
|
|
06533b977c | ||
|
|
07381e7275 | ||
|
|
22d022b2d5 | ||
|
|
42d6420400 | ||
|
|
ac85c8f901 | ||
|
|
5956569e7a | ||
|
|
59c4e381d1 | ||
|
|
1ab7b9ceb6 | ||
|
|
65c7c1b39b | ||
|
|
2d7cc778db | ||
|
|
fbb2f1e05a | ||
|
|
752030890f | ||
|
|
36dd848440 | ||
|
|
4b0fc3013f | ||
|
|
1152af4d02 | ||
|
|
b28ef78145 | ||
|
|
7f36f26422 | ||
|
|
411199bc99 | ||
|
|
4478f42927 | ||
|
|
9e659d13ed | ||
|
|
b8295afa27 | ||
|
|
3538c08a8b | ||
|
|
5ab1c9c75b | ||
|
|
2bbebf9752 | ||
|
|
f756bd5e11 | ||
|
|
fae073874b | ||
|
|
00f7134eb3 | ||
|
|
b20118b87c | ||
|
|
a48df102d6 | ||
|
|
3f7653a5c9 | ||
|
|
4df1e1928c | ||
|
|
83f17941b9 | ||
|
|
6963e5eeb0 | ||
|
|
86228e9964 | ||
|
|
480d6baf3b | ||
|
|
8b44c9dff1 | ||
|
|
ba63aa55a5 | ||
|
|
d45e306480 | ||
|
|
1c36fa9fe3 | ||
|
|
d0f0e17542 | ||
|
|
ffaeb11a61 | ||
|
|
4c1133be3f | ||
|
|
dff3386594 | ||
|
|
ca85ecb283 | ||
|
|
93ddf6e2ef | ||
|
|
ed82aaae97 | ||
|
|
581131e0fe | ||
|
|
08415d1d83 | ||
|
|
4d285939a6 | ||
|
|
eca8ec3cf8 | ||
|
|
0a7527b03e | ||
|
|
bcc3a9ecf7 | ||
|
|
f90f214121 | ||
|
|
0e621dcc29 | ||
|
|
8b054e6f8e | ||
|
|
88af8964fd | ||
|
|
199447a398 | ||
|
|
4c9d023468 | ||
|
|
d46cabcd4f | ||
|
|
6824bd8b24 | ||
|
|
f90507b527 | ||
|
|
3b584c2138 | ||
|
|
37cdc8e493 | ||
|
|
c684505cba | ||
|
|
1bf8c15206 | ||
|
|
b4f1581941 | ||
|
|
cf01bf4ae7 | ||
|
|
74eeb07b22 | ||
|
|
981b3a53ef | ||
|
|
9cb3ae1048 | ||
|
|
cbd78d7fca | ||
|
|
6e3176557c | ||
|
|
1713c7610d | ||
|
|
049f69c55b | ||
|
|
b9e863a9ca | ||
|
|
6358b11516 | ||
|
|
652b14c28f | ||
|
|
93cb215531 | ||
|
|
d5d8b7a118 | ||
|
|
45fcf3792a | ||
|
|
43590582c5 | ||
|
|
8253c28d6e | ||
|
|
fabe021fb0 | ||
|
|
8231cbfe81 | ||
|
|
a3cf964ce9 | ||
|
|
d0b728794d | ||
|
|
da62116c9d | ||
|
|
2c9bfdf29a | ||
|
|
64c2069256 | ||
|
|
3f3ecb6879 | ||
|
|
2f479f493f | ||
|
|
ee538be964 | ||
|
|
a0dd7394ac | ||
|
|
3f7725c9e2 | ||
|
|
ab644f9912 | ||
|
|
28a16bea24 | ||
|
|
2e81e612fc | ||
|
|
a4b1c269d8 | ||
|
|
2c4fdd0792 | ||
|
|
00c7d6f46b | ||
|
|
40f1f920df | ||
|
|
5775813031 | ||
|
|
d2576f411e | ||
|
|
76fecf744b | ||
|
|
f436904359 | ||
|
|
5cba55f8fb | ||
|
|
1413775e0e | ||
|
|
21e29d7177 | ||
|
|
5c7d902c4c | ||
|
|
e58cc2a282 | ||
|
|
84e2f60d6b | ||
|
|
944e1c3468 | ||
|
|
26b8d1f4c2 | ||
|
|
0fec25e92e | ||
|
|
1aa8a2bec4 | ||
|
|
1e735c69fa | ||
|
|
4223743ee0 | ||
|
|
29a85d54a2 | ||
|
|
a85bd0f8f9 | ||
|
|
610ca28681 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -232,3 +232,7 @@ samples/client/petstore/elm/index.html
|
|||||||
# C
|
# C
|
||||||
samples/client/petstore/c/build
|
samples/client/petstore/c/build
|
||||||
samples/client/petstore/c/*.so
|
samples/client/petstore/c/*.so
|
||||||
|
|
||||||
|
# Ruby
|
||||||
|
samples/openapi3/client/petstore/ruby/Gemfile.lock
|
||||||
|
samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock
|
||||||
|
|||||||
@@ -94,6 +94,12 @@ before_install:
|
|||||||
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
|
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
|
||||||
# - . ~/otp/18.2.1/activate && erl -version
|
# - . ~/otp/18.2.1/activate && erl -version
|
||||||
#- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
|
#- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
|
||||||
|
# install Qt 5.10
|
||||||
|
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install qt510-meta-minimal
|
||||||
|
- source /opt/qt510/bin/qt510-env.sh
|
||||||
|
- qmake -v
|
||||||
|
|
||||||
# show host table to confirm petstore.swagger.io is mapped to localhost
|
# show host table to confirm petstore.swagger.io is mapped to localhost
|
||||||
- cat /etc/hosts
|
- cat /etc/hosts
|
||||||
|
|||||||
20
CI/.drone.yml
Normal file
20
CI/.drone.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# test Java 11 HTTP client
|
||||||
|
- name: java11-test
|
||||||
|
image: hirokimatsumoto/alpine-openjdk-11
|
||||||
|
commands:
|
||||||
|
- ./mvnw clean install
|
||||||
|
- ./mvnw --quiet verify -Psamples.droneio
|
||||||
|
# test ocaml petstore client
|
||||||
|
- name: ocaml-test
|
||||||
|
image: ocaml/opam2:4.07
|
||||||
|
commands:
|
||||||
|
- sudo apt-get -y install m4
|
||||||
|
- cd samples/client/petstore/ocaml
|
||||||
|
- opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix
|
||||||
|
- eval $(opam env)
|
||||||
|
- sudo chmod -R 777 .
|
||||||
|
- dune build --build-dir=./_build
|
||||||
@@ -10,6 +10,7 @@ import java.util.TimeZone;
|
|||||||
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
|
||||||
|
|
||||||
public class ApiClientTest {
|
public class ApiClientTest {
|
||||||
@@ -329,24 +330,18 @@ public class ApiClientTest {
|
|||||||
assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif"));
|
assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInterceptorCleanupWithNewClient() {
|
public void testNewHttpClient() {
|
||||||
OkHttpClient oldClient = apiClient.getHttpClient();
|
OkHttpClient oldClient = apiClient.getHttpClient();
|
||||||
assertEquals(1, oldClient.networkInterceptors().size());
|
apiClient.setHttpClient(oldClient.newBuilder().build());
|
||||||
|
assertThat(apiClient.getHttpClient(), is(not(oldClient)));
|
||||||
OkHttpClient newClient = new OkHttpClient();
|
|
||||||
apiClient.setHttpClient(newClient);
|
|
||||||
assertEquals(1, apiClient.getHttpClient().networkInterceptors().size());
|
|
||||||
apiClient.setHttpClient(newClient);
|
|
||||||
assertEquals(1, apiClient.getHttpClient().networkInterceptors().size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
/**
|
||||||
public void testInterceptorCleanupWithSameClient() {
|
* Tests the invariant that the HttpClient for the ApiClient must never be null
|
||||||
OkHttpClient oldClient = apiClient.getHttpClient();
|
*/
|
||||||
assertEquals(1, oldClient.networkInterceptors().size());
|
@Test(expected = NullPointerException.class)
|
||||||
apiClient.setHttpClient(oldClient);
|
public void testNullHttpClient() {
|
||||||
assertEquals(1, apiClient.getHttpClient().networkInterceptors().size());
|
apiClient.setHttpClient(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class ArrayOfArrayOfNumberOnlyTest {
|
|||||||
List<BigDecimal> arrayArrayNumber = new ArrayList<BigDecimal>();
|
List<BigDecimal> arrayArrayNumber = new ArrayList<BigDecimal>();
|
||||||
arrayArrayNumber.add(b1);
|
arrayArrayNumber.add(b1);
|
||||||
arrayArrayNumber.add(b2);
|
arrayArrayNumber.add(b2);
|
||||||
|
model.setArrayArrayNumber(new ArrayList<List<BigDecimal>>());
|
||||||
model.getArrayArrayNumber().add(arrayArrayNumber);
|
model.getArrayArrayNumber().add(arrayArrayNumber);
|
||||||
|
|
||||||
// create another instance for comparison
|
// create another instance for comparison
|
||||||
@@ -62,6 +63,7 @@ public class ArrayOfArrayOfNumberOnlyTest {
|
|||||||
List<BigDecimal> arrayArrayNumber2 = new ArrayList<BigDecimal>();
|
List<BigDecimal> arrayArrayNumber2 = new ArrayList<BigDecimal>();
|
||||||
arrayArrayNumber2.add(b1);
|
arrayArrayNumber2.add(b1);
|
||||||
arrayArrayNumber2.add(b2);
|
arrayArrayNumber2.add(b2);
|
||||||
|
model2.setArrayArrayNumber(new ArrayList<List<BigDecimal>>());
|
||||||
model2.getArrayArrayNumber().add(arrayArrayNumber2);
|
model2.getArrayArrayNumber().add(arrayArrayNumber2);
|
||||||
|
|
||||||
Assert.assertTrue(model2.equals(model));
|
Assert.assertTrue(model2.equals(model));
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<project>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>TypeScriptAngularBuildPestoreClientTests</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<name>TS Fetch Multiple Parameters Petstore Client</name>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
78
README.md
78
README.md
@@ -6,16 +6,24 @@
|
|||||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||||
|
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||||
|
|
||||||
|
[`4.2.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.2.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||||
|
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||||
|
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||||
|
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||||
|
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||||
|
|
||||||
[`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
[`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||||
|
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[](https://gitter.im/OpenAPITools/openapi-generator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM)
|
||||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22)
|
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22)
|
||||||
[](https://twitter.com/oas_generator)
|
[](https://twitter.com/oas_generator)
|
||||||
|
|
||||||
@@ -46,12 +54,18 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
|||||||
[](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
[](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||||
[](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
[](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||||
|
|
||||||
|
#### Thank you GoDaddy for sponsoring the domain names and Linode for sponsoring the VPS
|
||||||
|
|
||||||
|
[<img src="https://openapi-generator.tech/img/companies/godaddy.png" width="150">](https://www.godaddy.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||||
|
[](https://www.linode.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||||
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification) (both 2.0 and 3.0 are supported). Currently, the following languages/frameworks are supported:
|
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification) (both 2.0 and 3.0 are supported). Currently, the following languages/frameworks are supported:
|
||||||
|
|
||||||
| | Languages/Frameworks |
|
| | Languages/Frameworks |
|
||||||
|-|-|
|
|-|-|
|
||||||
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **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, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
|
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **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, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
|
||||||
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
|
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
|
||||||
**API documentation generators** | **HTML**, **Confluence Wiki**
|
**API documentation generators** | **HTML**, **Confluence Wiki**
|
||||||
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
||||||
@@ -93,8 +107,9 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
|||||||
OpenAPI Generator Version | Release Date | Notes
|
OpenAPI Generator Version | Release Date | Notes
|
||||||
---------------------------- | ------------ | -----
|
---------------------------- | ------------ | -----
|
||||||
5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback)
|
5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback)
|
||||||
4.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.0-SNAPSHOT/)| 31.07.2019 | Minor release (breaking changes with fallbacks)
|
4.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.0-SNAPSHOT/)| 09.10.2019 | Minor release (breaking changes with fallbacks)
|
||||||
[4.0.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.0.3) (latest stable release) | 09.07.2019 | Patch release (bug fixes, minor enhancements, etc)
|
4.1.1 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.1-SNAPSHOT/)| 23.08.2019 | Patch release (bug fixes, enhancements)
|
||||||
|
[4.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.0) (latest stable release) | 09.08.2019 | Minor release (breaking changes with fallbacks)
|
||||||
|
|
||||||
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
||||||
|
|
||||||
@@ -150,16 +165,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
|||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
||||||
|
|
||||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar`
|
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar`
|
||||||
|
|
||||||
For **Mac/Linux** users:
|
For **Mac/Linux** users:
|
||||||
```sh
|
```sh
|
||||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar -O openapi-generator-cli.jar
|
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar -O openapi-generator-cli.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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 openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar
|
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||||
@@ -217,9 +232,9 @@ openapi-generator-cli version # is always 3.0.2, unless any of the above overrid
|
|||||||
|
|
||||||
To build from source, you need the following installed and available in your `$PATH:`
|
To build from source, you need the following installed and available in your `$PATH:`
|
||||||
|
|
||||||
* [Java 8](http://java.oracle.com)
|
* [Java 8](https://www.oracle.com/technetwork/java/index.html)
|
||||||
|
|
||||||
* [Apache Maven 3.3.4 or greater](http://maven.apache.org/)
|
* [Apache Maven 3.3.4 or greater](https://maven.apache.org/)
|
||||||
|
|
||||||
After cloning the project, you can build it from source with this command:
|
After cloning the project, you can build it from source with this command:
|
||||||
```sh
|
```sh
|
||||||
@@ -242,6 +257,17 @@ openapi-generator generate -i https://raw.githubusercontent.com/openapitools/ope
|
|||||||
|
|
||||||
To reinstall with the latest master, run `brew uninstall openapi-generator && brew install --HEAD openapi-generator`
|
To reinstall with the latest master, run `brew uninstall openapi-generator && brew install --HEAD openapi-generator`
|
||||||
|
|
||||||
|
To install OpenJDK (pre-requisites), please run
|
||||||
|
```sh
|
||||||
|
brew cask install adoptopenjdk12
|
||||||
|
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/
|
||||||
|
```
|
||||||
|
|
||||||
|
To install Maven, please run
|
||||||
|
```sh
|
||||||
|
brew install maven
|
||||||
|
```
|
||||||
|
|
||||||
### [1.6 - Docker](#table-of-contents)
|
### [1.6 - Docker](#table-of-contents)
|
||||||
|
|
||||||
#### Public Pre-built Docker images
|
#### Public Pre-built Docker images
|
||||||
@@ -342,7 +368,7 @@ Right now: no solution for this one :|
|
|||||||
#### Run Docker in Vagrant
|
#### Run Docker in Vagrant
|
||||||
Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
|
Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
|
||||||
```sh
|
```sh
|
||||||
git clone http://github.com/openapitools/openapi-generator.git
|
git clone https://github.com/openapitools/openapi-generator.git
|
||||||
cd openapi-generator
|
cd openapi-generator
|
||||||
vagrant up
|
vagrant up
|
||||||
vagrant ssh
|
vagrant ssh
|
||||||
@@ -363,10 +389,10 @@ openapi-generator version
|
|||||||
```
|
```
|
||||||
|
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
Or install a particular OpenAPI Generator version (e.g. v4.0.3):
|
Or install a particular OpenAPI Generator version (e.g. v4.1.0):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install @openapitools/openapi-generator-cli@cli-4.0.3 -g
|
npm install @openapitools/openapi-generator-cli@cli-4.1.0 -g
|
||||||
```
|
```
|
||||||
|
|
||||||
Or install it as dev-dependency:
|
Or install it as dev-dependency:
|
||||||
@@ -390,7 +416,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
|||||||
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||||
|
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar)
|
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar)
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
|
|
||||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||||
@@ -429,7 +455,6 @@ NAME
|
|||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
openapi-generator-cli generate
|
openapi-generator-cli generate
|
||||||
[(-a <authorization> | --auth <authorization>)]
|
[(-a <authorization> | --auth <authorization>)]
|
||||||
[--additional-properties <additional properties>...]
|
|
||||||
[--api-package <api package>] [--artifact-id <artifact id>]
|
[--api-package <api package>] [--artifact-id <artifact id>]
|
||||||
[--artifact-version <artifact version>]
|
[--artifact-version <artifact version>]
|
||||||
[(-c <configuration file> | --config <configuration file>)]
|
[(-c <configuration file> | --config <configuration file>)]
|
||||||
@@ -451,11 +476,12 @@ SYNOPSIS
|
|||||||
[--model-name-suffix <model name suffix>]
|
[--model-name-suffix <model name suffix>]
|
||||||
[--model-package <model package>]
|
[--model-package <model package>]
|
||||||
[(-o <output directory> | --output <output directory>)]
|
[(-o <output directory> | --output <output directory>)]
|
||||||
|
[(-p <additional properties> | --additional-properties <additional properties>)...]
|
||||||
[--package-name <package name>] [--release-note <release note>]
|
[--package-name <package name>] [--release-note <release note>]
|
||||||
[--remove-operation-id-prefix]
|
[--remove-operation-id-prefix]
|
||||||
[--reserved-words-mappings <reserved word mappings>...]
|
[--reserved-words-mappings <reserved word mappings>...]
|
||||||
[(-s | --skip-overwrite)] [--skip-validate-spec]
|
[(-s | --skip-overwrite)] [--server-variables <server variables>...]
|
||||||
[--strict-spec <true/false strict behavior>]
|
[--skip-validate-spec] [--strict-spec <true/false strict behavior>]
|
||||||
[(-t <template directory> | --template-dir <template directory>)]
|
[(-t <template directory> | --template-dir <template directory>)]
|
||||||
[--type-mappings <type mappings>...] [(-v | --verbose)]
|
[--type-mappings <type mappings>...] [(-v | --verbose)]
|
||||||
|
|
||||||
@@ -500,8 +526,8 @@ Please refer to [integration.md](docs/integration.md) on how to integrate OpenAP
|
|||||||
|
|
||||||
Here are the public online services:
|
Here are the public online services:
|
||||||
|
|
||||||
- latest stable version: http://api.openapi-generator.tech
|
- latest stable version: https://api.openapi-generator.tech
|
||||||
- latest master: http://api-latest-master.openapi-generator.tech (updated with latest master every hour)
|
- latest master: https://api-latest-master.openapi-generator.tech (updated with latest master every hour)
|
||||||
|
|
||||||
The server is sponsored by [Linode](https://www.linode.com/) [](https://www.linode.com/)
|
The server is sponsored by [Linode](https://www.linode.com/) [](https://www.linode.com/)
|
||||||
|
|
||||||
@@ -531,6 +557,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
|||||||
- [CAM](https://www.cam-inc.co.jp/)
|
- [CAM](https://www.cam-inc.co.jp/)
|
||||||
- [Camptocamp](https://www.camptocamp.com/en)
|
- [Camptocamp](https://www.camptocamp.com/en)
|
||||||
- [codecentric AG](https://www.codecentric.de/)
|
- [codecentric AG](https://www.codecentric.de/)
|
||||||
|
- [Commencis](https://www.commencis.com/)
|
||||||
- [Cupix](https://www.cupix.com/)
|
- [Cupix](https://www.cupix.com/)
|
||||||
- [DB Systel](https://www.dbsystel.de)
|
- [DB Systel](https://www.dbsystel.de)
|
||||||
- [FormAPI](https://formapi.io/)
|
- [FormAPI](https://formapi.io/)
|
||||||
@@ -575,6 +602,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
|||||||
- 2018/12/09 - [openapi-generator をカスタマイズする方法](https://qiita.com/watiko/items/0961287c02eac9211572) by [@watiko](https://qiita.com/watiko)
|
- 2018/12/09 - [openapi-generator をカスタマイズする方法](https://qiita.com/watiko/items/0961287c02eac9211572) by [@watiko](https://qiita.com/watiko)
|
||||||
- 2019/01/03 - [Calling a Swagger service from Apex using openapi-generator](https://lekkimworld.com/2019/01/03/calling-a-swagger-service-from-apex-using-openapi-generator/) by [Mikkel Flindt Heisterberg](https://lekkimworld.com)
|
- 2019/01/03 - [Calling a Swagger service from Apex using openapi-generator](https://lekkimworld.com/2019/01/03/calling-a-swagger-service-from-apex-using-openapi-generator/) by [Mikkel Flindt Heisterberg](https://lekkimworld.com)
|
||||||
- 2019/01/13 - [OpenAPI GeneratorでRESTful APIの定義書から色々自動生成する](https://ky-yk-d.hatenablog.com/entry/2019/01/13/234108) by [@ky_yk_d](https://twitter.com/ky_yk_d)
|
- 2019/01/13 - [OpenAPI GeneratorでRESTful APIの定義書から色々自動生成する](https://ky-yk-d.hatenablog.com/entry/2019/01/13/234108) by [@ky_yk_d](https://twitter.com/ky_yk_d)
|
||||||
|
- 2019/01/20 - [Contract-First API Development with OpenAPI Generator and Connexion](https://medium.com/commencis/contract-first-api-development-with-openapi-generator-and-connexion-b21bbf2f9244) by [Anil Can Aydin](https://github.com/anlcnydn)
|
||||||
- 2019/01/30 - [Rapid Application Development With API First Approach Using Open-API Generator](https://dzone.com/articles/rapid-api-development-using-open-api-generator) by [Milan Sonkar](https://dzone.com/users/828329/milan_sonkar.html)
|
- 2019/01/30 - [Rapid Application Development With API First Approach Using Open-API Generator](https://dzone.com/articles/rapid-api-development-using-open-api-generator) by [Milan Sonkar](https://dzone.com/users/828329/milan_sonkar.html)
|
||||||
- 2019/02/02 - [平静を保ち、コードを生成せよ 〜 OpenAPI Generator誕生の背景と軌跡 〜](https://speakerdeck.com/akihito_nakano/gunmaweb34) by [中野暁人](https://github.com/ackintosh) at [Gunma.web #34 スキーマ駆動開発](https://gunmaweb.connpass.com/event/113974/)
|
- 2019/02/02 - [平静を保ち、コードを生成せよ 〜 OpenAPI Generator誕生の背景と軌跡 〜](https://speakerdeck.com/akihito_nakano/gunmaweb34) by [中野暁人](https://github.com/ackintosh) at [Gunma.web #34 スキーマ駆動開発](https://gunmaweb.connpass.com/event/113974/)
|
||||||
- 2019/02/20 - [An adventure in OpenAPI V3 code generation](https://mux.com/blog/an-adventure-in-openapi-v3-api-code-generation/) by [Phil Cluff](https://mux.com/blog/author/philc/)
|
- 2019/02/20 - [An adventure in OpenAPI V3 code generation](https://mux.com/blog/an-adventure-in-openapi-v3-api-code-generation/) by [Phil Cluff](https://mux.com/blog/author/philc/)
|
||||||
@@ -597,6 +625,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
|||||||
- 2019-07-04 - [REST API のためのコード生成入門 (OpenAPI Generator)](https://gum.co/openapi_generator_ebook_big5) by [William Cheng](https://twitter.com/wing328), [中野暁人](https://github.com/ackintosh), [和田拓朗](https://github.com/taxpon)
|
- 2019-07-04 - [REST API のためのコード生成入門 (OpenAPI Generator)](https://gum.co/openapi_generator_ebook_big5) by [William Cheng](https://twitter.com/wing328), [中野暁人](https://github.com/ackintosh), [和田拓朗](https://github.com/taxpon)
|
||||||
- 2019-07-08 - [OpenAPI Generator にコントリビュートしたら社名が載った話。(CAM) - CAM TECH BLOG](https://tech.cam-inc.co.jp/entry/2019/07/08/140000) by [CAM, Inc.](https://www.cam-inc.co.jp/)
|
- 2019-07-08 - [OpenAPI Generator にコントリビュートしたら社名が載った話。(CAM) - CAM TECH BLOG](https://tech.cam-inc.co.jp/entry/2019/07/08/140000) by [CAM, Inc.](https://www.cam-inc.co.jp/)
|
||||||
- 2019-07-14 - [OpenAPI GeneratorでPythonのクライアントライブラリを作成した](https://qiita.com/yuji38kwmt/items/dfb929316a1335a161c0) by [yuji38kwmt](https://qiita.com/yuji38kwmt)
|
- 2019-07-14 - [OpenAPI GeneratorでPythonのクライアントライブラリを作成した](https://qiita.com/yuji38kwmt/items/dfb929316a1335a161c0) by [yuji38kwmt](https://qiita.com/yuji38kwmt)
|
||||||
|
- 2019-07-19 - [Developer Experience (DX) for Open-Source Projects: How to Engage Developers and Build a Growing Developer Community](https://speakerdeck.com/wing328/developer-experience-dx-for-open-source-projects-english-japanese) by [William Cheng](https://twitter.com/wing328), [中野暁人](https://github.com/ackintosh) at [Open Source Summit Japan 2019](https://events.linuxfoundation.org/events/open-source-summit-japan-2019/)
|
||||||
|
|
||||||
## [6 - About Us](#table-of-contents)
|
## [6 - About Us](#table-of-contents)
|
||||||
|
|
||||||
@@ -653,16 +682,19 @@ Here is a list of template creators:
|
|||||||
* Java (Vertx): @lopesmcc
|
* Java (Vertx): @lopesmcc
|
||||||
* Java (Google APIs Client Library): @charlescapps
|
* Java (Google APIs Client Library): @charlescapps
|
||||||
* Java (Rest-assured): @viclovsky
|
* Java (Rest-assured): @viclovsky
|
||||||
|
* Java (Java 11 Native HTTP client): @bbdouglas
|
||||||
* Javascript/NodeJS: @jfiala
|
* Javascript/NodeJS: @jfiala
|
||||||
* Javascript (Closure-annotated Angular) @achew22
|
* Javascript (Closure-annotated Angular) @achew22
|
||||||
* Javascript (Flow types) @jaypea
|
* Javascript (Flow types) @jaypea
|
||||||
* JMeter: @davidkiss
|
* JMeter: @davidkiss
|
||||||
* Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
* Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||||
* Lua: @daurnimator
|
* Lua: @daurnimator
|
||||||
|
* OCaml: @cgensoul
|
||||||
* Perl: @wing328 [:heart:](https://www.patreon.com/wing328)
|
* Perl: @wing328 [:heart:](https://www.patreon.com/wing328)
|
||||||
* PHP (Guzzle): @baartosz
|
* PHP (Guzzle): @baartosz
|
||||||
* PowerShell: @beatcracker
|
* PowerShell: @beatcracker
|
||||||
* R: @ramnov
|
* R: @ramnov
|
||||||
|
* Ruby (Faraday): @meganemura @dkliban
|
||||||
* Rust: @farcaller
|
* Rust: @farcaller
|
||||||
* Rust (rust-server): @metaswitch
|
* Rust (rust-server): @metaswitch
|
||||||
* Scala (scalaz & http4s): @tbrown1979
|
* Scala (scalaz & http4s): @tbrown1979
|
||||||
@@ -705,6 +737,7 @@ Here is a list of template creators:
|
|||||||
* JAX-RS RestEasy (JBoss EAP): @jfiala
|
* JAX-RS RestEasy (JBoss EAP): @jfiala
|
||||||
* Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
* Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||||
* Kotlin (Spring Boot): @dr4ke616
|
* Kotlin (Spring Boot): @dr4ke616
|
||||||
|
* NodeJS Express: @YishTish
|
||||||
* PHP Laravel: @renepardon
|
* PHP Laravel: @renepardon
|
||||||
* PHP Lumen: @abcsun
|
* PHP Lumen: @abcsun
|
||||||
* PHP Slim: @jfastnacht
|
* PHP Slim: @jfastnacht
|
||||||
@@ -764,7 +797,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
|||||||
| Apex | |
|
| Apex | |
|
||||||
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
|
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
|
||||||
| C | @zhemant (2018/11) |
|
| C | @zhemant (2018/11) |
|
||||||
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) |
|
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
|
||||||
| C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) |
|
| C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) |
|
||||||
| Clojure | |
|
| Clojure | |
|
||||||
| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) |
|
| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) |
|
||||||
@@ -773,7 +806,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
|||||||
| Elm | @eriktim (2018/09) |
|
| Elm | @eriktim (2018/09) |
|
||||||
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) |
|
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) |
|
||||||
| F# | @nmfisher (2019/05) |
|
| F# | @nmfisher (2019/05) |
|
||||||
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) @kemokemo (2018/09 |
|
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) @kemokemo (2018/09) @bkabrda (2019/07) |
|
||||||
| GraphQL | @renepardon (2018/12) |
|
| GraphQL | @renepardon (2018/12) |
|
||||||
| Groovy | |
|
| Groovy | |
|
||||||
| Haskell | |
|
| Haskell | |
|
||||||
@@ -782,13 +815,14 @@ If you want to join the committee, please kindly apply by sending an email to te
|
|||||||
| Lua | @daurnimator (2017/08) |
|
| Lua | @daurnimator (2017/08) |
|
||||||
| NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) |
|
| NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) |
|
||||||
| ObjC | |
|
| ObjC | |
|
||||||
|
| OCaml | @cgensoul (2019/08) |
|
||||||
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
|
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
|
||||||
| PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) |
|
| PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) |
|
||||||
| PowerShell | |
|
| PowerShell | |
|
||||||
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) |
|
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) |
|
||||||
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
|
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
|
||||||
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
|
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
|
||||||
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) |
|
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) |
|
||||||
| Scala | @clasnake (2017/07), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @shijinkui (2018/01), @ramzimaalej (2018/03) |
|
| Scala | @clasnake (2017/07), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @shijinkui (2018/01), @ramzimaalej (2018/03) |
|
||||||
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @d-date (2018/03) |
|
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @d-date (2018/03) |
|
||||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) |
|
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) |
|
||||||
@@ -861,7 +895,7 @@ Copyright 2018 SmartBear Software
|
|||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
|||||||
@@ -34,6 +34,6 @@ rm -rf $STUB_DIR
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR -DpackageName=petstore $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstore $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
./bin/java-petstore-feign-10x.sh
|
./bin/java-petstore-feign-10x.sh
|
||||||
./bin/java-petstore-okhttp-gson.sh
|
./bin/java-petstore-okhttp-gson.sh
|
||||||
./bin/java-petstore-okhttp-gson-parcelable.sh
|
./bin/java-petstore-okhttp-gson-parcelable.sh
|
||||||
|
./bin/java-petstore-native.sh
|
||||||
./bin/java-petstore-retrofit.sh
|
./bin/java-petstore-retrofit.sh
|
||||||
./bin/java-petstore-retrofit2.sh
|
./bin/java-petstore-retrofit2.sh
|
||||||
./bin/java-petstore-retrofit2rx.sh
|
./bin/java-petstore-retrofit2rx.sh
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 --additional-properties useNullForUnknownEnumValue=true $@"
|
ags="generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 $@"
|
||||||
|
|
||||||
echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main"
|
echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main"
|
||||||
rm -rf samples/client/petstore/java/jersey1/src/main
|
rm -rf samples/client/petstore/java/jersey1/src/main
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
{
|
{
|
||||||
"library": "jersey2",
|
"library": "jersey2",
|
||||||
"artifactId": "petstore-jersey2",
|
"artifactId": "petstore-jersey2"
|
||||||
"additionalProperties" : {
|
|
||||||
"useNullForUnknownEnumValue" : true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
4
bin/java-petstore-native.json
Normal file
4
bin/java-petstore-native.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"library": "native",
|
||||||
|
"artifactId": "petstore-native"
|
||||||
|
}
|
||||||
35
bin/java-petstore-native.sh
Executable file
35
bin/java-petstore-native.sh
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/native -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native --additional-properties hideGenerationTimestamp=true $@"
|
||||||
|
|
||||||
|
echo "Removing files and folders under samples/client/petstore/java/httpclient/src/main"
|
||||||
|
rm -rf samples/client/petstore/java/native/src/main
|
||||||
|
find samples/client/petstore/java/native -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
32
bin/nodejs-express-petstore-server.sh
Executable file
32
bin/nodejs-express-petstore-server.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -t modules/openapi-generator/src/main/resources/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server -Dservice $@"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
34
bin/ocaml-petstore.sh
Executable file
34
bin/ocaml-petstore.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
|
||||||
|
args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@"
|
||||||
|
|
||||||
|
echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
|
||||||
|
java $JAVA_OPTS -jar $executable $args
|
||||||
34
bin/openapi3/ocaml-client-petstore.sh
Executable file
34
bin/openapi3/ocaml-client-petstore.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties"
|
||||||
|
|
||||||
|
args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml -o samples/openapi3/client/petstore/ocaml/ --additional-properties packageName=petstore_client $@"
|
||||||
|
|
||||||
|
echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
|
||||||
|
java $JAVA_OPTS -jar $executable $args
|
||||||
@@ -23,7 +23,7 @@ if [ ! -d "${APP_DIR}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure that we are regenerating the sample by removing any existing target directory
|
# Make sure that we are regenerating the sample by removing any existing target directory
|
||||||
TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-symfony/SymfonyBundle-php"
|
TARGET_DIR="$SCRIPT_DIR/../../samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php"
|
||||||
if [ -d "$TARGET_DIR" ]; then
|
if [ -d "$TARGET_DIR" ]; then
|
||||||
rm -rf $TARGET_DIR
|
rm -rf $TARGET_DIR
|
||||||
fi
|
fi
|
||||||
|
|||||||
43
bin/openapi3/ruby-client-faraday-petstore.sh
Executable file
43
bin/openapi3/ruby-client-faraday-petstore.sh
Executable file
@@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# purge lib/doc folder
|
||||||
|
echo "purge ruby petstore lib, docs folder"
|
||||||
|
rm -Rf samples/openapi3/client/petstore/ruby-faraday/lib
|
||||||
|
rm -Rf samples/openapi3/client/petstore/ruby-faraday/docs
|
||||||
|
|
||||||
|
# purge test files other than integration test
|
||||||
|
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
|
||||||
|
echo "purge ruby petstore spec"
|
||||||
|
find samples/openapi3/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf
|
||||||
|
find samples/openapi3/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/openapi3/ruby-petstore-faraday.json -o samples/openapi3/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
6
bin/openapi3/ruby-petstore-faraday.json
Normal file
6
bin/openapi3/ruby-petstore-faraday.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"gemName": "petstore",
|
||||||
|
"moduleName": "Petstore",
|
||||||
|
"library": "faraday",
|
||||||
|
"gemVersion": "1.0.0"
|
||||||
|
}
|
||||||
32
bin/ruby-client-petstore-faraday.sh
Executable file
32
bin/ruby-client-petstore-faraday.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday $@"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
6
bin/ruby-petstore-faraday.json
Normal file
6
bin/ruby-petstore-faraday.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"gemName": "petstore",
|
||||||
|
"moduleName": "Petstore",
|
||||||
|
"library": "faraday",
|
||||||
|
"gemVersion": "1.0.0"
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"gemName": "petstore",
|
"gemName": "petstore",
|
||||||
|
"library": "typhoeus",
|
||||||
"moduleName": "Petstore",
|
"moduleName": "Petstore",
|
||||||
"gemVersion": "1.0.0"
|
"gemVersion": "1.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,8 @@ for spec_path in modules/openapi-generator/src/test/resources/*/rust-server/* ;
|
|||||||
$@"
|
$@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $args
|
java $JAVA_OPTS -jar $executable $args
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Generate clients:
|
# Generate clients:
|
||||||
./bin/spring-cloud-feign-petstore.sh
|
./bin/spring-cloud-feign-petstore.sh
|
||||||
|
./bin/spring-cloud-feign-async-petstore.sh
|
||||||
./bin/spring-stubs.sh
|
./bin/spring-stubs.sh
|
||||||
|
|
||||||
# Generate spring-mvc servers:
|
# Generate spring-mvc servers:
|
||||||
|
|||||||
35
bin/spring-cloud-feign-async-petstore.sh
Executable file
35
bin/spring-cloud-feign-async-petstore.sh
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g spring -c bin/spring-cloud-feign-petstore.json -o samples/client/petstore/spring-cloud-async --additional-properties hideGenerationTimestamp=true,java8=true,async=true $@"
|
||||||
|
|
||||||
|
echo "Removing files and folders under samples/client/petstore/spring-cloud-async/src/main"
|
||||||
|
rm -rf samples/client/petstore/spring-cloud-async/src/main
|
||||||
|
find samples/client/petstore/spring-cloud-async -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
@@ -30,3 +30,13 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|||||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-objcCompatible.json -o samples/client/petstore/swift4/objcCompatible $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-objcCompatible.json -o samples/client/petstore/swift4/objcCompatible $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
if type "xcodegen" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/objcCompatible
|
||||||
|
xcodegen generate
|
||||||
|
fi
|
||||||
|
|
||||||
|
if type "swiftlint" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/objcCompatible
|
||||||
|
swiftlint autocorrect
|
||||||
|
fi
|
||||||
@@ -30,3 +30,13 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|||||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-promisekit.json -o samples/client/petstore/swift4/promisekit --generate-alias-as-model $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-promisekit.json -o samples/client/petstore/swift4/promisekit --generate-alias-as-model $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
if type "xcodegen" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/promisekit
|
||||||
|
xcodegen generate
|
||||||
|
fi
|
||||||
|
|
||||||
|
if type "swiftlint" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/promisekit
|
||||||
|
swiftlint autocorrect
|
||||||
|
fi
|
||||||
@@ -30,3 +30,13 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|||||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-rxswift.json -o samples/client/petstore/swift4/rxswift --generate-alias-as-model $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-rxswift.json -o samples/client/petstore/swift4/rxswift --generate-alias-as-model $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
if type "xcodegen" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/rxswift
|
||||||
|
xcodegen generate
|
||||||
|
fi
|
||||||
|
|
||||||
|
if type "swiftlint" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/rxswift
|
||||||
|
swiftlint autocorrect
|
||||||
|
fi
|
||||||
@@ -30,3 +30,13 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|||||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-unwrapRequired.json -o samples/client/petstore/swift4/unwrapRequired --generate-alias-as-model $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-unwrapRequired.json -o samples/client/petstore/swift4/unwrapRequired --generate-alias-as-model $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
if type "xcodegen" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/unwrapRequired
|
||||||
|
xcodegen generate
|
||||||
|
fi
|
||||||
|
|
||||||
|
if type "swiftlint" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/unwrapRequired
|
||||||
|
swiftlint autocorrect
|
||||||
|
fi
|
||||||
@@ -30,3 +30,13 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|||||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore.json -o samples/client/petstore/swift4/default --generate-alias-as-model $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore.json -o samples/client/petstore/swift4/default --generate-alias-as-model $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
if type "xcodegen" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/default
|
||||||
|
xcodegen generate
|
||||||
|
fi
|
||||||
|
|
||||||
|
if type "swiftlint" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/petstore/swift4/default
|
||||||
|
swiftlint autocorrect
|
||||||
|
fi
|
||||||
|
|||||||
@@ -30,3 +30,13 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|||||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift4Test.json -g swift4 -c ./bin/swift4-test.json -o samples/client/test/swift4/default $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift4Test.json -g swift4 -c ./bin/swift4-test.json -o samples/client/test/swift4/default $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
|
if type "xcodegen" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/test/swift4/default
|
||||||
|
xcodegen generate
|
||||||
|
fi
|
||||||
|
|
||||||
|
if type "swiftlint" > /dev/null 2>&1; then
|
||||||
|
cd samples/client/test/swift4/default
|
||||||
|
swiftlint autocorrect
|
||||||
|
fi
|
||||||
|
|||||||
@@ -13,3 +13,4 @@
|
|||||||
./bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.sh
|
./bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.sh
|
||||||
./bin/typescript-angular-v7-petstore-provided-in-root.sh
|
./bin/typescript-angular-v7-petstore-provided-in-root.sh
|
||||||
./bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh
|
./bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh
|
||||||
|
./bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"npmName": "@openapitools/typescript-angular-petstore",
|
"npmName": "@openapitools/typescript-angular-petstore",
|
||||||
"npmVersion": "1.0.0",
|
"npmVersion": "1.0.0",
|
||||||
"npmRepository" : "https://skimdb.npmjs.com/registry",
|
"stringEnums": true,
|
||||||
"snapshot" : false
|
"npmRepository": "https://skimdb.npmjs.com/registry",
|
||||||
|
"snapshot": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"npmName": "@openapitools/typescript-angular-petstore",
|
||||||
|
"npmVersion": "1.0.0",
|
||||||
|
"npmRepository" : "https://skimdb.npmjs.com/registry",
|
||||||
|
"snapshot" : false,
|
||||||
|
"ngVersion": "8.0.0"
|
||||||
|
}
|
||||||
32
bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh
Executable file
32
bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm --additional-properties ngVersion=8.0.0 $@"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
./bin/typescript-axios-petstore-target-es6.sh
|
./bin/typescript-axios-petstore-target-es6.sh
|
||||||
./bin/typescript-axios-petstore-with-npm-version.sh
|
./bin/typescript-axios-petstore-with-npm-version.sh
|
||||||
./bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh
|
./bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh
|
||||||
|
./bin/typescript-axios-petstore-with-complex-headers.sh
|
||||||
./bin/typescript-axios-petstore-interfaces.sh
|
./bin/typescript-axios-petstore-interfaces.sh
|
||||||
./bin/typescript-axios-petstore.sh
|
./bin/typescript-axios-petstore.sh
|
||||||
|
|||||||
32
bin/typescript-axios-petstore-with-complex-headers.sh
Executable file
32
bin/typescript-axios-petstore-with-complex-headers.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/with-complex-headers $@"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
@@ -4,3 +4,4 @@
|
|||||||
./bin/typescript-fetch-petstore-with-npm-version.sh
|
./bin/typescript-fetch-petstore-with-npm-version.sh
|
||||||
./bin/typescript-fetch-petstore-interfaces.sh
|
./bin/typescript-fetch-petstore-interfaces.sh
|
||||||
./bin/typescript-fetch-petstore.sh
|
./bin/typescript-fetch-petstore.sh
|
||||||
|
./bin/typescript-fetch-petstore-multiple-parameters.sh
|
||||||
4
bin/typescript-fetch-petstore-multiple-parameters.json
Normal file
4
bin/typescript-fetch-petstore-multiple-parameters.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"snapshot" : false,
|
||||||
|
"useSingleRequestParameter": false
|
||||||
|
}
|
||||||
34
bin/typescript-fetch-petstore-multiple-parameters.sh
Executable file
34
bin/typescript-fetch-petstore-multiple-parameters.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-multiple-parameters.json -o samples/client/petstore/typescript-fetch/builds/multiple-parameters $@"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
cp CI/samples.ci/client/petstore/typescript-fetch/builds/multiple-parameters/pom.xml samples/client/petstore/typescript-fetch/builds/multiple-parameters/pom.xml
|
||||||
|
cp CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml samples/client/petstore/typescript-fetch/tests/default/pom.xml
|
||||||
@@ -12,8 +12,9 @@ sleep 5
|
|||||||
# LIST OF SCRIPTS:
|
# LIST OF SCRIPTS:
|
||||||
declare -a scripts=(
|
declare -a scripts=(
|
||||||
# SAMPLES
|
# SAMPLES
|
||||||
"./bin/openapi3/ruby-client-petstore.sh"
|
|
||||||
"./bin/ruby-client-petstore.sh"
|
"./bin/ruby-client-petstore.sh"
|
||||||
|
"./bin/openapi3/ruby-client-petstore.sh"
|
||||||
|
"./bin/openapi3/ruby-client-faraday-petstore.sh"
|
||||||
"./bin/java-petstore-all.sh"
|
"./bin/java-petstore-all.sh"
|
||||||
"./bin/java-jaxrs-petstore-server-all.sh"
|
"./bin/java-jaxrs-petstore-server-all.sh"
|
||||||
"./bin/java-msf4j-petstore-server.sh"
|
"./bin/java-msf4j-petstore-server.sh"
|
||||||
@@ -57,11 +58,11 @@ declare -a scripts=(
|
|||||||
"./bin/groovy-petstore.sh"
|
"./bin/groovy-petstore.sh"
|
||||||
"./bin/apex-petstore.sh"
|
"./bin/apex-petstore.sh"
|
||||||
"./bin/perl-petstore-all.sh"
|
"./bin/perl-petstore-all.sh"
|
||||||
|
"./bin/dart-jaguar-petstore.sh"
|
||||||
#"./bin/elm-petstore-all.sh"
|
#"./bin/elm-petstore-all.sh"
|
||||||
"./bin/meta-codegen.sh"
|
"./bin/meta-codegen.sh"
|
||||||
# OTHERS
|
# OTHERS
|
||||||
"./bin/utils/export_docs_generators.sh"
|
"./bin/utils/export_docs_generators.sh"
|
||||||
"./bin/utils/export_generators_docusaurus_index.sh"
|
|
||||||
"./bin/utils/copy-to-website.sh"
|
"./bin/utils/copy-to-website.sh"
|
||||||
"./bin/utils/export_generators_readme.sh")
|
"./bin/utils/export_generators_readme.sh")
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ echo "# START SCRIPT: ${SCRIPT}"
|
|||||||
|
|
||||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
for GENERATOR in $(java -jar ${executable} list --short | sed -e 's/,/\'$'\n''/g')
|
for GENERATOR in $(java -jar ${executable} list --short --include all | sed -e 's/,/\'$'\n''/g')
|
||||||
do
|
do
|
||||||
./bin/utils/export_generator.sh ${GENERATOR}
|
./bin/utils/export_generator.sh ${GENERATOR}
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SCRIPT="$0"
|
|
||||||
echo "# START SCRIPT: $SCRIPT"
|
|
||||||
|
|
||||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
|
||||||
|
|
||||||
\rm -rf docs/generators.md
|
|
||||||
|
|
||||||
cat > docs/generators.md << EOF
|
|
||||||
---
|
|
||||||
id: generators
|
|
||||||
title: Generators List
|
|
||||||
---
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
java -jar $executable list --docsite >> docs/generators.md
|
|
||||||
|
|
||||||
echo "Wrote $(pwd)/docs/generators.md"
|
|
||||||
@@ -15,6 +15,6 @@ title: Generators List
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
java -jar $executable list | sed -e 's/\([A-Z]*\) generators:/* \1 generators:/g' -e 's/- \([a-z0-9\-]*\)/- [\1]\(generators\/\1.md\)/g' >> docs/generators.md
|
java -jar $executable list --docsite --include all >> docs/generators.md
|
||||||
|
|
||||||
echo "Wrote $(pwd)/docs/generators.md"
|
echo "Wrote $(pwd)/docs/generators.md"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ artifactid=openapi-generator-cli
|
|||||||
ver=${OPENAPI_GENERATOR_VERSION:-$(latest.tag $ghrepo)}
|
ver=${OPENAPI_GENERATOR_VERSION:-$(latest.tag $ghrepo)}
|
||||||
|
|
||||||
jar=${artifactid}-${ver}.jar
|
jar=${artifactid}-${ver}.jar
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR=${OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR:-"$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"}
|
||||||
|
|
||||||
if [ ! -f ${DIR}/${jar} ]; then
|
if [ ! -f ${DIR}/${jar} ]; then
|
||||||
repo="central::default::https://repo1.maven.org/maven2/"
|
repo="central::default::https://repo1.maven.org/maven2/"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ call .\bin\windows\java-petstore-jersey1.bat
|
|||||||
call .\bin\windows\java-petstore-jersey2.bat
|
call .\bin\windows\java-petstore-jersey2.bat
|
||||||
call .\bin\windows\java-petstore-feign.bat
|
call .\bin\windows\java-petstore-feign.bat
|
||||||
call .\bin\windows\java-petstore-feign-10x.bat
|
call .\bin\windows\java-petstore-feign-10x.bat
|
||||||
|
call .\bin\windows\java-petstore-native.bat
|
||||||
call .\bin\windows\java-petstore-okhttp-gson.bat
|
call .\bin\windows\java-petstore-okhttp-gson.bat
|
||||||
call .\bin\windows\java-petstore-okhttp-gson-parcelable.bat
|
call .\bin\windows\java-petstore-okhttp-gson-parcelable.bat
|
||||||
call .\bin\windows\java-petstore-retrofit.bat
|
call .\bin\windows\java-petstore-retrofit.bat
|
||||||
|
|||||||
10
bin/windows/java-petstore-native.bat
Normal file
10
bin/windows/java-petstore-native.bat
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||||
|
|
||||||
|
If Not Exist %executable% (
|
||||||
|
mvn clean package
|
||||||
|
)
|
||||||
|
|
||||||
|
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||||
|
set ags=generate -t modules\openapi-generator\src\main\resources\Java\libraries\native -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-native.json -o samples\client\petstore\java\native --additional-properties hideGenerationTimestamp=true
|
||||||
|
|
||||||
|
java %JAVA_OPTS% -jar %executable% %ags%
|
||||||
10
bin/windows/ocaml-petstore.bat
Executable file
10
bin/windows/ocaml-petstore.bat
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||||
|
|
||||||
|
If Not Exist %executable% (
|
||||||
|
mvn clean package
|
||||||
|
)
|
||||||
|
|
||||||
|
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||||
|
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g ocaml -o samples\client\petstore\ocaml
|
||||||
|
|
||||||
|
java %JAVA_OPTS% -jar %executable% %ags%
|
||||||
10
bin/windows/python-experimental-petstore.bat
Normal file
10
bin/windows/python-experimental-petstore.bat
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||||
|
|
||||||
|
If Not Exist %executable% (
|
||||||
|
mvn clean package
|
||||||
|
)
|
||||||
|
|
||||||
|
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||||
|
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples\client\petstore\python-experimental -DpackageName=petstore_api
|
||||||
|
|
||||||
|
java %JAVA_OPTS% -jar %executable% %ags%
|
||||||
@@ -11,4 +11,4 @@ call .\bin\windows\typescript-angular-v7-provided-in-root.bat
|
|||||||
call .\bin\windows\typescript-angular-v7-provided-in-root-with-npm.bat
|
call .\bin\windows\typescript-angular-v7-provided-in-root-with-npm.bat
|
||||||
call .\bin\windows\typescript-angular-v7-not-provided-in-root.bat
|
call .\bin\windows\typescript-angular-v7-not-provided-in-root.bat
|
||||||
call .\bin\windows\typescript-angular-v7-not-provided-in-root-with-npm.bat
|
call .\bin\windows\typescript-angular-v7-not-provided-in-root-with-npm.bat
|
||||||
|
call .\bin\windows\typescript-angular-v8-provided-in-root-with-npm.bat
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||||
|
|
||||||
|
If Not Exist %executable% (
|
||||||
|
mvn clean package
|
||||||
|
)
|
||||||
|
|
||||||
|
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v8-provided-in-root\builds\with-npm --additional-properties ngVersion=8.0.0
|
||||||
|
|
||||||
|
java %JAVA_OPTS% -jar %executable% %ags%
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
call bin\windows\typescript-axios-petstore.bat
|
call bin\windows\typescript-axios-petstore.bat
|
||||||
call bin\windows\typescript-axios-petstore-target-es6.bat
|
call bin\windows\typescript-axios-petstore-target-es6.bat
|
||||||
|
call bin\windows\typescript-axios-petstore-with-complex-headers.bat
|
||||||
call bin\windows\typescript-axios-petstore-with-npm-version.bat
|
call bin\windows\typescript-axios-petstore-with-npm-version.bat
|
||||||
call bin\windows\typescript-axios-petstore-interfaces.bat
|
call bin\windows\typescript-axios-petstore-interfaces.bat
|
||||||
call bin\windows\typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat
|
call bin\windows\typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat
|
||||||
12
bin/windows/typescript-axios-petstore-with-complex-headers.bat
Executable file
12
bin/windows/typescript-axios-petstore-with-complex-headers.bat
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
|
||||||
|
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||||
|
|
||||||
|
If Not Exist %executable% (
|
||||||
|
mvn clean package
|
||||||
|
)
|
||||||
|
|
||||||
|
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||||
|
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-complex-headers.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\with-complex-headers
|
||||||
|
|
||||||
|
java %JAVA_OPTS% -jar %executable% %ags%
|
||||||
@@ -4,3 +4,4 @@ call bin\windows\typescript-fetch-petstore.bat
|
|||||||
call bin\windows\typescript-fetch-petstore-target-es6.bat
|
call bin\windows\typescript-fetch-petstore-target-es6.bat
|
||||||
call bin\windows\typescript-fetch-petstore-with-npm-version.bat
|
call bin\windows\typescript-fetch-petstore-with-npm-version.bat
|
||||||
call bin\windows\typescript-fetch-petstore-interfaces.bat
|
call bin\windows\typescript-fetch-petstore-interfaces.bat
|
||||||
|
call bin\windows\typescript-fetch-petstore-multiple-parameters.bat
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
|
||||||
|
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||||
|
|
||||||
|
If Not Exist %executable% (
|
||||||
|
mvn clean package
|
||||||
|
)
|
||||||
|
|
||||||
|
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||||
|
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin\typescript-fetch-petstore-multiple-parameters.json -o samples\client\petstore\typescript-fetch\builds\multiple-parameters
|
||||||
|
|
||||||
|
java %JAVA_OPTS% -jar %executable% %ags%
|
||||||
@@ -19,7 +19,7 @@ if [[ -f "${codegen}" && -n "$(java ${JAVA_OPTS} -jar "${codegen}" completion |
|
|||||||
command=$1
|
command=$1
|
||||||
shift
|
shift
|
||||||
exec java ${JAVA_OPTS} -jar "${codegen}" "${command}" "$@"
|
exec java ${JAVA_OPTS} -jar "${codegen}" "${command}" "$@"
|
||||||
elif [[ -n "$(echo commands | tr ',' '\n' | grep "^$1\$" )" ]]; then
|
elif [[ -n "$(echo $commands | tr ',' '\n' | grep "^$1\$" )" ]]; then
|
||||||
# If CLI jar does not exist, and $1 is a known CLI command, build the CLI jar and run that command.
|
# If CLI jar does not exist, and $1 is a known CLI command, build the CLI jar and run that command.
|
||||||
if [[ ! -f "${codegen}" ]]; then
|
if [[ ! -f "${codegen}" ]]; then
|
||||||
(cd "${GEN_DIR}" && exec mvn -am -pl "modules/openapi-generator-cli" -Duser.home=$(dirname $MAVEN_CONFIG) package)
|
(cd "${GEN_DIR}" && exec mvn -am -pl "modules/openapi-generator-cli" -Duser.home=$(dirname $MAVEN_CONFIG) package)
|
||||||
|
|||||||
@@ -62,3 +62,26 @@ The steps are shown here for a specific version of the generator, but apply the
|
|||||||
Listening for transport dt_socket at address: 5005
|
Listening for transport dt_socket at address: 5005
|
||||||
```
|
```
|
||||||
* Set breakpoints in code, and then attach your remote debugger from your IDE (see above). The generator will automatically unblock once the remote debugger is attached. You can now step through the code.
|
* Set breakpoints in code, and then attach your remote debugger from your IDE (see above). The generator will automatically unblock once the remote debugger is attached. You can now step through the code.
|
||||||
|
|
||||||
|
## Logs
|
||||||
|
|
||||||
|
You can try to enable debugging log with `-Dlog.level=debug` option to the `JAVA_OPTS` environment variable to see more information:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=debug"
|
||||||
|
```
|
||||||
|
|
||||||
|
Set the option then DEBUG logs are printed out:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
openapi-generator generate -g go ...
|
||||||
|
|
||||||
|
...
|
||||||
|
...
|
||||||
|
[main] DEBUG o.o.codegen.DefaultCodegen - debugging fromProperty for files : class Schema {
|
||||||
|
type: null
|
||||||
|
format: null
|
||||||
|
$ref: #/components/schemas/File
|
||||||
|
...
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|||||||
@@ -5,130 +5,132 @@ title: Generators List
|
|||||||
|
|
||||||
The following generators are available:
|
The following generators are available:
|
||||||
|
|
||||||
* CLIENT generators:
|
## CLIENT generators
|
||||||
- [ada](generators/ada.md)
|
* [ada](generators/ada)
|
||||||
- [android](generators/android.md)
|
* [android](generators/android)
|
||||||
- [apex](generators/apex.md)
|
* [apex](generators/apex)
|
||||||
- [bash](generators/bash.md)
|
* [bash](generators/bash)
|
||||||
- [c](generators/c.md)
|
* [c](generators/c)
|
||||||
- [clojure](generators/clojure.md)
|
* [clojure](generators/clojure)
|
||||||
- [cpp-qt5-client](generators/cpp-qt5-client.md)
|
* [cpp-qt5-client](generators/cpp-qt5-client)
|
||||||
- [cpp-restsdk](generators/cpp-restsdk.md)
|
* [cpp-restsdk](generators/cpp-restsdk)
|
||||||
- [cpp-tizen](generators/cpp-tizen.md)
|
* [cpp-tizen](generators/cpp-tizen)
|
||||||
- [csharp](generators/csharp.md)
|
* [csharp](generators/csharp)
|
||||||
- [csharp-dotnet2](generators/csharp-dotnet2.md) (deprecated)
|
* [csharp-dotnet2 (deprecated)](generators/csharp-dotnet2)
|
||||||
- [csharp-netcore](generators/csharp-netcore.md)
|
* [csharp-netcore](generators/csharp-netcore)
|
||||||
- [dart](generators/dart.md)
|
* [dart](generators/dart)
|
||||||
- [dart-jaguar](generators/dart-jaguar.md)
|
* [dart-jaguar](generators/dart-jaguar)
|
||||||
- [eiffel](generators/eiffel.md)
|
* [eiffel](generators/eiffel)
|
||||||
- [elixir](generators/elixir.md)
|
* [elixir](generators/elixir)
|
||||||
- [elm](generators/elm.md)
|
* [elm](generators/elm)
|
||||||
- [erlang-client](generators/erlang-client.md)
|
* [erlang-client](generators/erlang-client)
|
||||||
- [erlang-proper](generators/erlang-proper.md)
|
* [erlang-proper](generators/erlang-proper)
|
||||||
- [flash](generators/flash.md)
|
* [flash](generators/flash)
|
||||||
- [go](generators/go.md)
|
* [go](generators/go)
|
||||||
- [go-experimental](generators/go-experimental.md)
|
* [go-experimental (experimental)](generators/go-experimental)
|
||||||
- [groovy](generators/groovy.md)
|
* [groovy](generators/groovy)
|
||||||
- [haskell-http-client](generators/haskell-http-client.md)
|
* [haskell-http-client](generators/haskell-http-client)
|
||||||
- [java](generators/java.md)
|
* [java](generators/java)
|
||||||
- [javascript](generators/javascript.md)
|
* [javascript](generators/javascript)
|
||||||
- [javascript-closure-angular](generators/javascript-closure-angular.md)
|
* [javascript-closure-angular](generators/javascript-closure-angular)
|
||||||
- [javascript-flowtyped](generators/javascript-flowtyped.md)
|
* [javascript-flowtyped](generators/javascript-flowtyped)
|
||||||
- [jaxrs-cxf-client](generators/jaxrs-cxf-client.md)
|
* [jaxrs-cxf-client](generators/jaxrs-cxf-client)
|
||||||
- [jmeter](generators/jmeter.md)
|
* [jmeter](generators/jmeter)
|
||||||
- [kotlin](generators/kotlin.md)
|
* [kotlin](generators/kotlin)
|
||||||
- [lua](generators/lua.md)
|
* [lua](generators/lua)
|
||||||
- [objc](generators/objc.md)
|
* [objc](generators/objc)
|
||||||
- [perl](generators/perl.md)
|
* [ocaml](generators/ocaml)
|
||||||
- [php](generators/php.md)
|
* [perl](generators/perl)
|
||||||
- [powershell](generators/powershell.md)
|
* [php](generators/php)
|
||||||
- [python](generators/python.md)
|
* [powershell](generators/powershell)
|
||||||
- [python-experimental](generators/python-experimental.md)
|
* [python](generators/python)
|
||||||
- [r](generators/r.md)
|
* [python-experimental (experimental)](generators/python-experimental)
|
||||||
- [ruby](generators/ruby.md)
|
* [r](generators/r)
|
||||||
- [rust](generators/rust.md)
|
* [ruby](generators/ruby)
|
||||||
- [scala-akka](generators/scala-akka.md)
|
* [rust](generators/rust)
|
||||||
- [scala-gatling](generators/scala-gatling.md)
|
* [scala-akka](generators/scala-akka)
|
||||||
- [scala-httpclient-deprecated](generators/scala-httpclient-deprecated.md) (deprecated)
|
* [scala-gatling](generators/scala-gatling)
|
||||||
- [scalaz](generators/scalaz.md)
|
* [scala-httpclient-deprecated (deprecated)](generators/scala-httpclient-deprecated)
|
||||||
- [swift2-deprecated](generators/swift2-deprecated.md) (deprecated)
|
* [scalaz](generators/scalaz)
|
||||||
- [swift3-deprecated](generators/swift3-deprecated.md) (deprecated)
|
* [swift2-deprecated (deprecated)](generators/swift2-deprecated)
|
||||||
- [swift4](generators/swift4.md)
|
* [swift3-deprecated (deprecated)](generators/swift3-deprecated)
|
||||||
- [typescript-angular](generators/typescript-angular.md)
|
* [swift4](generators/swift4)
|
||||||
- [typescript-angularjs](generators/typescript-angularjs.md)
|
* [typescript-angular](generators/typescript-angular)
|
||||||
- [typescript-aurelia](generators/typescript-aurelia.md)
|
* [typescript-angularjs](generators/typescript-angularjs)
|
||||||
- [typescript-axios](generators/typescript-axios.md)
|
* [typescript-aurelia](generators/typescript-aurelia)
|
||||||
- [typescript-fetch](generators/typescript-fetch.md)
|
* [typescript-axios](generators/typescript-axios)
|
||||||
- [typescript-inversify](generators/typescript-inversify.md)
|
* [typescript-fetch](generators/typescript-fetch)
|
||||||
- [typescript-jquery](generators/typescript-jquery.md)
|
* [typescript-inversify](generators/typescript-inversify)
|
||||||
- [typescript-node](generators/typescript-node.md)
|
* [typescript-jquery](generators/typescript-jquery)
|
||||||
- [typescript-rxjs](generators/typescript-rxjs.md)
|
* [typescript-node](generators/typescript-node)
|
||||||
|
* [typescript-rxjs](generators/typescript-rxjs)
|
||||||
|
|
||||||
|
|
||||||
* SERVER generators:
|
## SERVER generators
|
||||||
- [ada-server](generators/ada-server.md)
|
* [ada-server](generators/ada-server)
|
||||||
- [aspnetcore](generators/aspnetcore.md)
|
* [aspnetcore](generators/aspnetcore)
|
||||||
- [cpp-pistache-server](generators/cpp-pistache-server.md)
|
* [cpp-pistache-server](generators/cpp-pistache-server)
|
||||||
- [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server.md)
|
* [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server)
|
||||||
- [cpp-restbed-server](generators/cpp-restbed-server.md)
|
* [cpp-restbed-server](generators/cpp-restbed-server)
|
||||||
- [csharp-nancyfx](generators/csharp-nancyfx.md)
|
* [csharp-nancyfx](generators/csharp-nancyfx)
|
||||||
- [erlang-server](generators/erlang-server.md)
|
* [erlang-server](generators/erlang-server)
|
||||||
- [fsharp-giraffe-server](generators/fsharp-giraffe-server.md)
|
* [fsharp-giraffe-server](generators/fsharp-giraffe-server)
|
||||||
- [go-gin-server](generators/go-gin-server.md)
|
* [go-gin-server](generators/go-gin-server)
|
||||||
- [go-server](generators/go-server.md)
|
* [go-server](generators/go-server)
|
||||||
- [graphql-nodejs-express-server](generators/graphql-nodejs-express-server.md)
|
* [graphql-nodejs-express-server](generators/graphql-nodejs-express-server)
|
||||||
- [haskell](generators/haskell.md)
|
* [haskell](generators/haskell)
|
||||||
- [java-inflector](generators/java-inflector.md)
|
* [java-inflector](generators/java-inflector)
|
||||||
- [java-msf4j](generators/java-msf4j.md)
|
* [java-msf4j](generators/java-msf4j)
|
||||||
- [java-pkmst](generators/java-pkmst.md)
|
* [java-pkmst](generators/java-pkmst)
|
||||||
- [java-play-framework](generators/java-play-framework.md)
|
* [java-play-framework](generators/java-play-framework)
|
||||||
- [java-undertow-server](generators/java-undertow-server.md)
|
* [java-undertow-server](generators/java-undertow-server)
|
||||||
- [java-vertx](generators/java-vertx.md)
|
* [java-vertx](generators/java-vertx)
|
||||||
- [jaxrs-cxf](generators/jaxrs-cxf.md)
|
* [jaxrs-cxf](generators/jaxrs-cxf)
|
||||||
- [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi.md)
|
* [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi)
|
||||||
- [jaxrs-cxf-extended](generators/jaxrs-cxf-extended.md)
|
* [jaxrs-cxf-extended](generators/jaxrs-cxf-extended)
|
||||||
- [jaxrs-jersey](generators/jaxrs-jersey.md)
|
* [jaxrs-jersey](generators/jaxrs-jersey)
|
||||||
- [jaxrs-resteasy](generators/jaxrs-resteasy.md)
|
* [jaxrs-resteasy](generators/jaxrs-resteasy)
|
||||||
- [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap.md)
|
* [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap)
|
||||||
- [jaxrs-spec](generators/jaxrs-spec.md)
|
* [jaxrs-spec](generators/jaxrs-spec)
|
||||||
- [kotlin-server](generators/kotlin-server.md)
|
* [kotlin-server](generators/kotlin-server)
|
||||||
- [kotlin-spring](generators/kotlin-spring.md)
|
* [kotlin-spring](generators/kotlin-spring)
|
||||||
- [nodejs-server-deprecated](generators/nodejs-server-deprecated.md) (deprecated)
|
* [nodejs-express-server (beta)](generators/nodejs-express-server)
|
||||||
- [php-laravel](generators/php-laravel.md)
|
* [nodejs-server-deprecated (deprecated)](generators/nodejs-server-deprecated)
|
||||||
- [php-lumen](generators/php-lumen.md)
|
* [php-laravel](generators/php-laravel)
|
||||||
- [php-silex](generators/php-silex.md)
|
* [php-lumen](generators/php-lumen)
|
||||||
- [php-slim](generators/php-slim.md)
|
* [php-silex](generators/php-silex)
|
||||||
- [php-symfony](generators/php-symfony.md)
|
* [php-slim](generators/php-slim)
|
||||||
- [php-ze-ph](generators/php-ze-ph.md)
|
* [php-symfony](generators/php-symfony)
|
||||||
- [python-aiohttp](generators/python-aiohttp.md)
|
* [php-ze-ph](generators/php-ze-ph)
|
||||||
- [python-blueplanet](generators/python-blueplanet.md)
|
* [python-aiohttp](generators/python-aiohttp)
|
||||||
- [python-flask](generators/python-flask.md)
|
* [python-blueplanet](generators/python-blueplanet)
|
||||||
- [ruby-on-rails](generators/ruby-on-rails.md)
|
* [python-flask](generators/python-flask)
|
||||||
- [ruby-sinatra](generators/ruby-sinatra.md)
|
* [ruby-on-rails](generators/ruby-on-rails)
|
||||||
- [rust-server](generators/rust-server.md)
|
* [ruby-sinatra](generators/ruby-sinatra)
|
||||||
- [scala-finch](generators/scala-finch.md)
|
* [rust-server](generators/rust-server)
|
||||||
- [scala-lagom-server](generators/scala-lagom-server.md)
|
* [scala-finch](generators/scala-finch)
|
||||||
- [scala-play-server](generators/scala-play-server.md)
|
* [scala-lagom-server](generators/scala-lagom-server)
|
||||||
- [scalatra](generators/scalatra.md)
|
* [scala-play-server](generators/scala-play-server)
|
||||||
- [spring](generators/spring.md)
|
* [scalatra](generators/scalatra)
|
||||||
|
* [spring](generators/spring)
|
||||||
|
|
||||||
|
|
||||||
* DOCUMENTATION generators:
|
## DOCUMENTATION generators
|
||||||
- [cwiki](generators/cwiki.md)
|
* [cwiki](generators/cwiki)
|
||||||
- [dynamic-html](generators/dynamic-html.md)
|
* [dynamic-html](generators/dynamic-html)
|
||||||
- [html](generators/html.md)
|
* [html](generators/html)
|
||||||
- [html2](generators/html2.md)
|
* [html2](generators/html2)
|
||||||
- [openapi](generators/openapi.md)
|
* [openapi](generators/openapi)
|
||||||
- [openapi-yaml](generators/openapi-yaml.md)
|
* [openapi-yaml](generators/openapi-yaml)
|
||||||
|
|
||||||
|
|
||||||
* SCHEMA generators:
|
## SCHEMA generators
|
||||||
- [mysql-schema](generators/mysql-schema.md)
|
* [mysql-schema](generators/mysql-schema)
|
||||||
|
|
||||||
|
|
||||||
* CONFIG generators:
|
## CONFIG generators
|
||||||
- [apache2](generators/apache2.md)
|
* [apache2](generators/apache2)
|
||||||
- [graphql-schema](generators/graphql-schema.md)
|
* [graphql-schema](generators/graphql-schema)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ sidebar_label: cpp-qt5-client
|
|||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|modelNamePrefix|Prefix that will be prepended to all model names.| |OAI|
|
||||||
|optionalProjectFile|Generate client.pri.| |true|
|
|optionalProjectFile|Generate client.pri.| |true|
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ sidebar_label: cpp-qt5-qhttpengine-server
|
|||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|modelNamePrefix|Prefix that will be prepended to all model names.| |OAI|
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ sidebar_label: dart-jaguar
|
|||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|browserClient|Is the client browser based| |null|
|
|browserClient|Is the client browser based (for Dart 1.x only)| |null|
|
||||||
|pubName|Name in generated pubspec| |null|
|
|pubName|Name in generated pubspec| |null|
|
||||||
|pubVersion|Version in generated pubspec| |null|
|
|pubVersion|Version in generated pubspec| |null|
|
||||||
|pubDescription|Description in generated pubspec| |null|
|
|pubDescription|Description in generated pubspec| |null|
|
||||||
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null|
|
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null|
|
||||||
|sourceFolder|source folder for generated code| |null|
|
|sourceFolder|Source folder for generated code| |null|
|
||||||
|supportDart2|support dart2| |true|
|
|supportDart2|Support Dart 2.x| |true|
|
||||||
|nullableFields|Is the null fields should be in the JSON payload| |null|
|
|nullableFields|Is the null fields should be in the JSON payload| |null|
|
||||||
|serialization|Choose serialization format JSON or PROTO is supported| |null|
|
|serialization|Choose serialization format JSON or PROTO is supported| |null|
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ sidebar_label: dart
|
|||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|browserClient|Is the client browser based| |null|
|
|browserClient|Is the client browser based (for Dart 1.x only)| |null|
|
||||||
|pubName|Name in generated pubspec| |null|
|
|pubName|Name in generated pubspec| |null|
|
||||||
|pubVersion|Version in generated pubspec| |null|
|
|pubVersion|Version in generated pubspec| |null|
|
||||||
|pubDescription|Description in generated pubspec| |null|
|
|pubDescription|Description in generated pubspec| |null|
|
||||||
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null|
|
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null|
|
||||||
|sourceFolder|source folder for generated code| |null|
|
|sourceFolder|Source folder for generated code| |null|
|
||||||
|supportDart2|support dart2| |true|
|
|supportDart2|Support Dart 2.x| |true|
|
||||||
|
|||||||
@@ -55,4 +55,4 @@ sidebar_label: java
|
|||||||
|feignVersion|Version of OpenFeign: '10.x', '9.x' (default)| |false|
|
|feignVersion|Version of OpenFeign: '10.x', '9.x' (default)| |false|
|
||||||
|useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false|
|
|useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false|
|
||||||
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false|
|
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false|
|
||||||
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.8.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.8.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.8.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit**</dt><dd>HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.8.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.8.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.8.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.8.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x. Only for Java8</dd><dl>|okhttp-gson|
|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.8.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.8.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.8.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit**</dt><dd>HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.8.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.8.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.8.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.8.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x. Only for Java8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dl>|okhttp-gson|
|
||||||
|
|||||||
14
docs/generators/nodejs-express-server.md
Normal file
14
docs/generators/nodejs-express-server.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
id: generator-opts-server-nodejs-express-server
|
||||||
|
title: Config Options for nodejs-express-server
|
||||||
|
sidebar_label: nodejs-express-server
|
||||||
|
---
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|
|serverPort|TCP port to listen on.| |null|
|
||||||
13
docs/generators/ocaml-client.md
Normal file
13
docs/generators/ocaml-client.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
id: generator-opts-client-ocaml-client
|
||||||
|
title: Config Options for ocaml-client
|
||||||
|
sidebar_label: ocaml-client
|
||||||
|
---
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
13
docs/generators/ocaml.md
Normal file
13
docs/generators/ocaml.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
id: generator-opts-client-ocaml
|
||||||
|
title: Config Options for ocaml
|
||||||
|
sidebar_label: ocaml
|
||||||
|
---
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
@@ -11,4 +11,4 @@ sidebar_label: openapi-yaml
|
|||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|outputFile|output filename| |null|
|
|outputFile|Output filename| |openapi/openapi.yaml|
|
||||||
|
|||||||
@@ -22,3 +22,4 @@ sidebar_label: ruby
|
|||||||
|gemAuthor|gem author (only one is supported).| |null|
|
|gemAuthor|gem author (only one is supported).| |null|
|
||||||
|gemAuthorEmail|gem author email (only one is supported).| |null|
|
|gemAuthorEmail|gem author email (only one is supported).| |null|
|
||||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||||
|
|library|HTTP library template (sub-template) to use|<dl><dt>**faraday**</dt><dd>Faraday (https://github.com/lostisland/faraday) (Beta support)</dd><dt>**typhoeus**</dt><dd>Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)</dd><dl>|typhoeus|
|
||||||
|
|||||||
@@ -26,3 +26,4 @@ sidebar_label: typescript-angular
|
|||||||
|modelSuffix|The suffix of the generated model.| |null|
|
|modelSuffix|The suffix of the generated model.| |null|
|
||||||
|modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null|
|
|modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null|
|
||||||
|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase|
|
|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase|
|
||||||
|
|stringEnums|Generate string enums instead of objects for enum values.| |false|
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ sidebar_label: typescript-fetch
|
|||||||
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|
||||||
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|
||||||
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
||||||
|
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true|
|
||||||
|
|||||||
@@ -759,6 +759,21 @@ Supporting files can either be processed through the templating engine or copied
|
|||||||
- **isContainer**: true if the parameter or property is an array or a map.
|
- **isContainer**: true if the parameter or property is an array or a map.
|
||||||
- **isPrimitiveType**: true if the parameter or property type is a primitive type (e.g. string, integer, etc) as defined in the spec.
|
- **isPrimitiveType**: true if the parameter or property type is a primitive type (e.g. string, integer, etc) as defined in the spec.
|
||||||
|
|
||||||
|
## Mustache Lambdas
|
||||||
|
|
||||||
|
Many generators (*those extending DefaultCodegen*) come with a small set of lambda functions available under the key `lambda`:
|
||||||
|
|
||||||
|
- `lowercase` - Converts all of the characters in this fragment to lower case using the rules of the `ROOT` locale.
|
||||||
|
- `uppercase` - Converts all of the characters in this fragment to upper case using the rules of the `ROOT` locale.
|
||||||
|
- `titlecase` - Converts text in a fragment to title case. For example `once upon a time` to `Once Upon A Time`.
|
||||||
|
- `camelcase` - Converts text in a fragment to camelCase. For example `Input-text` to `inputText`.
|
||||||
|
- `indented` - Prepends 4 spaces indention from second line of a fragment on. First line will be indented by Mustache.
|
||||||
|
- `indented_8` - Prepends 8 spaces indention from second line of a fragment on. First line will be indented by Mustache.
|
||||||
|
- `indented_12` - Prepends 12 spaces indention from second line of a fragment on. First line will be indented by Mustache.
|
||||||
|
- `indented_16` -Prepends 16 spaces indention from second line of a fragment on. First line will be indented by Mustache.
|
||||||
|
|
||||||
|
Lambda is invoked by `lambda.[lambda name]` expression. For example: `{{#lambda.lowercase}}FRAGMENT TO LOWERCASE{{/lambda.lowercase}}` to lower case text between `lambda.lowercase`.
|
||||||
|
|
||||||
## Extensions
|
## Extensions
|
||||||
|
|
||||||
OpenAPI supports a concept called "Extensions". These are called "Specification Extensions" [in 3.x](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#specificationExtensions) and "Vendor Extensions" [in 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#vendorExtensions).
|
OpenAPI supports a concept called "Extensions". These are called "Specification Extensions" [in 3.x](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#specificationExtensions) and "Vendor Extensions" [in 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#vendorExtensions).
|
||||||
|
|||||||
@@ -38,9 +38,15 @@ NAME
|
|||||||
openapi-generator-cli list - Lists the available generators
|
openapi-generator-cli list - Lists the available generators
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
openapi-generator-cli list [(-s | --short)]
|
openapi-generator-cli list [(-i <include> | --include <include>)]
|
||||||
|
[(-s | --short)]
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
|
-i <include>, --include <include>
|
||||||
|
comma-separated list of stability indexes to include (value:
|
||||||
|
all,beta,stable,experimental,deprecated). Excludes deprecated by
|
||||||
|
default.
|
||||||
|
|
||||||
-s, --short
|
-s, --short
|
||||||
shortened output (suitable for scripting)
|
shortened output (suitable for scripting)
|
||||||
|
|
||||||
@@ -210,13 +216,14 @@ This command takes one or more parameters representing the args list you would o
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
openapi-generator completion config-help
|
openapi-generator completion config-help
|
||||||
--named-header
|
|
||||||
-o
|
-o
|
||||||
--output
|
--output
|
||||||
|
--named-header
|
||||||
-g
|
-g
|
||||||
--generator-name
|
--generator-name
|
||||||
-l
|
-f
|
||||||
--lang
|
--format
|
||||||
|
--markdown-header
|
||||||
```
|
```
|
||||||
|
|
||||||
An example bash completion script can be found in the repo at [scripts/openapi-generator-cli-completion.bash](https://github.com/OpenAPITools/openapi-generator/blob/master/scripts/openapi-generator-cli-completion.bash).
|
An example bash completion script can be found in the repo at [scripts/openapi-generator-cli-completion.bash](https://github.com/OpenAPITools/openapi-generator/blob/master/scripts/openapi-generator-cli-completion.bash).
|
||||||
@@ -235,7 +242,6 @@ NAME
|
|||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
openapi-generator-cli generate
|
openapi-generator-cli generate
|
||||||
[(-a <authorization> | --auth <authorization>)]
|
[(-a <authorization> | --auth <authorization>)]
|
||||||
[--additional-properties <additional properties>...]
|
|
||||||
[--api-package <api package>] [--artifact-id <artifact id>]
|
[--api-package <api package>] [--artifact-id <artifact id>]
|
||||||
[--artifact-version <artifact version>]
|
[--artifact-version <artifact version>]
|
||||||
[(-c <configuration file> | --config <configuration file>)]
|
[(-c <configuration file> | --config <configuration file>)]
|
||||||
@@ -257,14 +263,14 @@ SYNOPSIS
|
|||||||
[--model-name-suffix <model name suffix>]
|
[--model-name-suffix <model name suffix>]
|
||||||
[--model-package <model package>]
|
[--model-package <model package>]
|
||||||
[(-o <output directory> | --output <output directory>)]
|
[(-o <output directory> | --output <output directory>)]
|
||||||
|
[(-p <additional properties> | --additional-properties <additional properties>)...]
|
||||||
[--package-name <package name>] [--release-note <release note>]
|
[--package-name <package name>] [--release-note <release note>]
|
||||||
[--remove-operation-id-prefix]
|
[--remove-operation-id-prefix]
|
||||||
[--reserved-words-mappings <reserved word mappings>...]
|
[--reserved-words-mappings <reserved word mappings>...]
|
||||||
[(-s | --skip-overwrite)] [--skip-validate-spec]
|
[(-s | --skip-overwrite)] [--server-variables <server variables>...]
|
||||||
[--strict-spec <true/false strict behavior>]
|
[--skip-validate-spec] [--strict-spec <true/false strict behavior>]
|
||||||
[(-t <template directory> | --template-dir <template directory>)]
|
[(-t <template directory> | --template-dir <template directory>)]
|
||||||
[--type-mappings <type mappings>...] [(-v | --verbose)]
|
[--type-mappings <type mappings>...] [(-v | --verbose)]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@@ -277,19 +283,16 @@ OPTIONS
|
|||||||
remotely. Pass in a URL-encoded string of name:header with a comma
|
remotely. Pass in a URL-encoded string of name:header with a comma
|
||||||
separating multiple values
|
separating multiple values
|
||||||
|
|
||||||
--additional-properties <additional properties>
|
|
||||||
sets additional properties that can be referenced by the mustache
|
|
||||||
templates in the format of name=value,name=value. You can also have
|
|
||||||
multiple occurrences of this option.
|
|
||||||
|
|
||||||
--api-package <api package>
|
--api-package <api package>
|
||||||
package for generated api classes
|
package for generated api classes
|
||||||
|
|
||||||
--artifact-id <artifact id>
|
--artifact-id <artifact id>
|
||||||
artifactId in generated pom.xml
|
artifactId in generated pom.xml. This also becomes part of the
|
||||||
|
generated library's filename
|
||||||
|
|
||||||
--artifact-version <artifact version>
|
--artifact-version <artifact version>
|
||||||
artifact version in generated pom.xml
|
artifact version in generated pom.xml. This also becomes part of the
|
||||||
|
generated library's filename
|
||||||
|
|
||||||
-c <configuration file>, --config <configuration file>
|
-c <configuration file>, --config <configuration file>
|
||||||
Path to configuration file configuration file. It can be json or
|
Path to configuration file configuration file. It can be json or
|
||||||
@@ -382,6 +385,12 @@ OPTIONS
|
|||||||
-o <output directory>, --output <output directory>
|
-o <output directory>, --output <output directory>
|
||||||
where to write the generated files (current dir by default)
|
where to write the generated files (current dir by default)
|
||||||
|
|
||||||
|
-p <additional properties>, --additional-properties <additional
|
||||||
|
properties>
|
||||||
|
sets additional properties that can be referenced by the mustache
|
||||||
|
templates in the format of name=value,name=value. You can also have
|
||||||
|
multiple occurrences of this option.
|
||||||
|
|
||||||
--package-name <package name>
|
--package-name <package name>
|
||||||
package for generated classes (where supported)
|
package for generated classes (where supported)
|
||||||
|
|
||||||
@@ -400,6 +409,10 @@ OPTIONS
|
|||||||
specifies if the existing files should be overwritten during the
|
specifies if the existing files should be overwritten during the
|
||||||
generation.
|
generation.
|
||||||
|
|
||||||
|
--server-variables <server variables>
|
||||||
|
sets server variables for spec documents which support variable
|
||||||
|
templating of servers.
|
||||||
|
|
||||||
--skip-validate-spec
|
--skip-validate-spec
|
||||||
Skips the default behavior of validating an input specification.
|
Skips the default behavior of validating an input specification.
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.0-SNAPSHOT</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -18,13 +18,7 @@
|
|||||||
package org.openapitools.codegen.cmd;
|
package org.openapitools.codegen.cmd;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyAdditionalPropertiesKvpList;
|
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.*;
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyImportMappingsKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyInstantiationTypesKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyLanguageSpecificPrimitivesCsvList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyReservedWordsMappingsKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applySystemPropertiesKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyTypeMappingsKvpList;
|
|
||||||
|
|
||||||
import ch.qos.logback.classic.LoggerContext;
|
import ch.qos.logback.classic.LoggerContext;
|
||||||
import ch.qos.logback.core.spi.FilterAttachable;
|
import ch.qos.logback.core.spi.FilterAttachable;
|
||||||
@@ -160,6 +154,12 @@ public class Generate implements Runnable {
|
|||||||
+ " You can also have multiple occurrences of this option.")
|
+ " You can also have multiple occurrences of this option.")
|
||||||
private List<String> importMappings = new ArrayList<>();
|
private List<String> importMappings = new ArrayList<>();
|
||||||
|
|
||||||
|
@Option(
|
||||||
|
name = {"--server-variables"},
|
||||||
|
title = "server variables",
|
||||||
|
description = "sets server variables overrides for spec documents which support variable templating of servers.")
|
||||||
|
private List<String> serverVariableOverrides = new ArrayList<>();
|
||||||
|
|
||||||
@Option(name = {"--invoker-package"}, title = "invoker package",
|
@Option(name = {"--invoker-package"}, title = "invoker package",
|
||||||
description = CodegenConstants.INVOKER_PACKAGE_DESC)
|
description = CodegenConstants.INVOKER_PACKAGE_DESC)
|
||||||
private String invokerPackage;
|
private String invokerPackage;
|
||||||
@@ -393,6 +393,7 @@ public class Generate implements Runnable {
|
|||||||
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
|
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
|
||||||
applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator);
|
applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator);
|
||||||
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
|
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
|
||||||
|
applyServerVariablesKvpList(serverVariableOverrides, configurator);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||||
|
|||||||
@@ -5,15 +5,14 @@ import com.google.common.base.Objects;
|
|||||||
import io.airlift.airline.Command;
|
import io.airlift.airline.Command;
|
||||||
import io.airlift.airline.Option;
|
import io.airlift.airline.Option;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.CodegenConfig;
|
import org.openapitools.codegen.CodegenConfig;
|
||||||
import org.openapitools.codegen.CodegenConfigLoader;
|
import org.openapitools.codegen.CodegenConfigLoader;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||||
import org.openapitools.codegen.meta.Stability;
|
import org.openapitools.codegen.meta.Stability;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
// NOTE: List can later have subcommands such as list languages, list types, list frameworks, etc.
|
// NOTE: List can later have subcommands such as list languages, list types, list frameworks, etc.
|
||||||
@@ -26,9 +25,31 @@ public class ListGenerators implements Runnable {
|
|||||||
@Option(name = {"-d", "--docsite" }, description = "format for docusaurus site output", hidden = true)
|
@Option(name = {"-d", "--docsite" }, description = "format for docusaurus site output", hidden = true)
|
||||||
private Boolean docusaurus = false;
|
private Boolean docusaurus = false;
|
||||||
|
|
||||||
|
@Option(name = {"-i", "--include" },
|
||||||
|
description = "comma-separated list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default.",
|
||||||
|
allowedValues = { "all", "beta", "stable", "experimental", "deprecated" })
|
||||||
|
private String include = "stable,beta,experimental";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
List<CodegenConfig> generators = CodegenConfigLoader.getAll();
|
List<CodegenConfig> generators = new ArrayList<>();
|
||||||
|
List<Stability> stabilities = Arrays.asList(Stability.values());
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(include)) {
|
||||||
|
List<String> includes = Arrays.asList(include.split(","));
|
||||||
|
if (includes.size() != 0 && !includes.contains("all")) {
|
||||||
|
stabilities = includes.stream()
|
||||||
|
.map(Stability::forDescription)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (CodegenConfig codegenConfig : CodegenConfigLoader.getAll()) {
|
||||||
|
GeneratorMetadata meta = codegenConfig.getGeneratorMetadata();
|
||||||
|
if (meta != null && stabilities.contains(meta.getStability())) {
|
||||||
|
generators.add(codegenConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.0-SNAPSHOT</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
private ImmutableMap<String, String> importMappings;
|
private ImmutableMap<String, String> importMappings;
|
||||||
private ImmutableSet<String> languageSpecificPrimitives;
|
private ImmutableSet<String> languageSpecificPrimitives;
|
||||||
private ImmutableMap<String, String> reservedWordMappings;
|
private ImmutableMap<String, String> reservedWordMappings;
|
||||||
|
private ImmutableMap<String, String> serverVariables;
|
||||||
|
|
||||||
private String gitUserId;
|
private String gitUserId;
|
||||||
private String gitRepoId;
|
private String gitRepoId;
|
||||||
@@ -245,6 +246,17 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
return reservedWordMappings;
|
return reservedWordMappings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets server variable. Values defined here will be attempted to be replaced within a templated server object.
|
||||||
|
*
|
||||||
|
* @return the server variables
|
||||||
|
*/
|
||||||
|
public Map<String, String> getServerVariables() {
|
||||||
|
return serverVariables;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets git user id. e.g. <strong>openapitools</strong>.
|
* Gets git user id. e.g. <strong>openapitools</strong>.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -311,6 +323,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
importMappings = ImmutableMap.copyOf(builder.importMappings);
|
importMappings = ImmutableMap.copyOf(builder.importMappings);
|
||||||
languageSpecificPrimitives = ImmutableSet.copyOf(builder.languageSpecificPrimitives);
|
languageSpecificPrimitives = ImmutableSet.copyOf(builder.languageSpecificPrimitives);
|
||||||
reservedWordMappings = ImmutableMap.copyOf(builder.reservedWordMappings);
|
reservedWordMappings = ImmutableMap.copyOf(builder.reservedWordMappings);
|
||||||
|
serverVariables = ImmutableMap.copyOf(builder.serverVariables);
|
||||||
gitUserId = builder.gitUserId;
|
gitUserId = builder.gitUserId;
|
||||||
gitRepoId = builder.gitRepoId;
|
gitRepoId = builder.gitRepoId;
|
||||||
releaseNote = builder.releaseNote;
|
releaseNote = builder.releaseNote;
|
||||||
@@ -373,6 +386,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
importMappings = ImmutableMap.of();
|
importMappings = ImmutableMap.of();
|
||||||
languageSpecificPrimitives = ImmutableSet.of();
|
languageSpecificPrimitives = ImmutableSet.of();
|
||||||
reservedWordMappings = ImmutableMap.of();
|
reservedWordMappings = ImmutableMap.of();
|
||||||
|
serverVariables = ImmutableMap.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaults() {
|
private void setDefaults() {
|
||||||
@@ -394,12 +408,6 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* New builder builder.
|
|
||||||
*
|
|
||||||
* @param copy the copy
|
|
||||||
* @return the builder
|
|
||||||
*/
|
|
||||||
public static Builder newBuilder(GeneratorSettings copy) {
|
public static Builder newBuilder(GeneratorSettings copy) {
|
||||||
Builder builder = new Builder();
|
Builder builder = new Builder();
|
||||||
builder.generatorName = copy.getGeneratorName();
|
builder.generatorName = copy.getGeneratorName();
|
||||||
@@ -419,6 +427,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
builder.importMappings = new HashMap<>(copy.getImportMappings());
|
builder.importMappings = new HashMap<>(copy.getImportMappings());
|
||||||
builder.languageSpecificPrimitives = new HashSet<>(copy.getLanguageSpecificPrimitives());
|
builder.languageSpecificPrimitives = new HashSet<>(copy.getLanguageSpecificPrimitives());
|
||||||
builder.reservedWordMappings = new HashMap<>(copy.getReservedWordMappings());
|
builder.reservedWordMappings = new HashMap<>(copy.getReservedWordMappings());
|
||||||
|
builder.serverVariables = new HashMap<>(copy.getServerVariables());
|
||||||
builder.gitUserId = copy.getGitUserId();
|
builder.gitUserId = copy.getGitUserId();
|
||||||
builder.gitRepoId = copy.getGitRepoId();
|
builder.gitRepoId = copy.getGitRepoId();
|
||||||
builder.releaseNote = copy.getReleaseNote();
|
builder.releaseNote = copy.getReleaseNote();
|
||||||
@@ -449,6 +458,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
private Map<String, String> importMappings;
|
private Map<String, String> importMappings;
|
||||||
private Set<String> languageSpecificPrimitives;
|
private Set<String> languageSpecificPrimitives;
|
||||||
private Map<String, String> reservedWordMappings;
|
private Map<String, String> reservedWordMappings;
|
||||||
|
private Map<String, String> serverVariables;
|
||||||
private String gitUserId;
|
private String gitUserId;
|
||||||
private String gitRepoId;
|
private String gitRepoId;
|
||||||
private String releaseNote;
|
private String releaseNote;
|
||||||
@@ -464,6 +474,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
importMappings = new HashMap<>();
|
importMappings = new HashMap<>();
|
||||||
languageSpecificPrimitives = new HashSet<>();
|
languageSpecificPrimitives = new HashSet<>();
|
||||||
reservedWordMappings = new HashMap<>();
|
reservedWordMappings = new HashMap<>();
|
||||||
|
serverVariables = new HashMap<>();
|
||||||
|
|
||||||
gitUserId = DEFAULT_GIT_USER_ID;
|
gitUserId = DEFAULT_GIT_USER_ID;
|
||||||
gitRepoId = DEFAULT_GIT_REPO_ID;
|
gitRepoId = DEFAULT_GIT_REPO_ID;
|
||||||
@@ -617,6 +628,17 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the {@code serverVariables} and returns a reference to this Builder so that the methods can be chained together.
|
||||||
|
*
|
||||||
|
* @param serverVariables the {@code serverVariables} to set
|
||||||
|
* @return a reference to this Builder
|
||||||
|
*/
|
||||||
|
public Builder withServerVariables(Map<String, String> serverVariables) {
|
||||||
|
this.serverVariables = serverVariables;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@code typeMappings} and returns a reference to this Builder so that the methods can be chained together.
|
* Sets the {@code typeMappings} and returns a reference to this Builder so that the methods can be chained together.
|
||||||
*
|
*
|
||||||
@@ -731,6 +753,22 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a single {@code serverVariables} and returns a reference to this Builder so that the methods can be chained together.
|
||||||
|
*
|
||||||
|
* @param key A key for some server variable
|
||||||
|
* @param value The value of some server variable to be replaced in a templated server object.
|
||||||
|
* @return a reference to this Builder
|
||||||
|
*/
|
||||||
|
public Builder withServerVariable(String key, String value) {
|
||||||
|
if (this.serverVariables == null) {
|
||||||
|
this.serverVariables = new HashMap<>();
|
||||||
|
}
|
||||||
|
this.serverVariables.put(key, value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@code gitUserId} and returns a reference to this Builder so that the methods can be chained together.
|
* Sets the {@code gitUserId} and returns a reference to this Builder so that the methods can be chained together.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -50,4 +50,14 @@ public enum Stability {
|
|||||||
* @return The descriptive value of this enum.
|
* @return The descriptive value of this enum.
|
||||||
*/
|
*/
|
||||||
public String value() { return description; }
|
public String value() { return description; }
|
||||||
|
|
||||||
|
public static Stability forDescription(String description) {
|
||||||
|
for (Stability value: values()) {
|
||||||
|
if (value.description.equals(description)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new IllegalArgumentException("description not found in the available values.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ compileJava.dependsOn tasks.openApiGenerate
|
|||||||
[source,group]
|
[source,group]
|
||||||
----
|
----
|
||||||
plugins {
|
plugins {
|
||||||
id "org.openapi.generator" version "4.0.3"
|
id "org.openapi.generator" version "4.1.0"
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ buildscript {
|
|||||||
// url "https://plugins.gradle.org/m2/"
|
// url "https://plugins.gradle.org/m2/"
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.openapitools:openapi-generator-gradle-plugin:4.0.3"
|
classpath "org.openapitools:openapi-generator-gradle-plugin:4.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,6 +374,18 @@ openApiGenerate {
|
|||||||
|
|
||||||
|===
|
|===
|
||||||
|
|
||||||
|
=== openApiGenerators
|
||||||
|
|
||||||
|
.Options
|
||||||
|
|===
|
||||||
|
|Key |Data Type |Default |Description
|
||||||
|
|
||||||
|
|include
|
||||||
|
|String[]
|
||||||
|
|None
|
||||||
|
|A list of stability indexes to include (values: all,beta,stable,experimental,deprecated). Excludes deprecated by default.
|
||||||
|
|
||||||
|
|===
|
||||||
|
|
||||||
== Examples
|
== Examples
|
||||||
|
|
||||||
@@ -609,7 +621,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||||
classpath('org.openapitools:openapi-generator-gradle-plugin:4.0.3') {
|
classpath('org.openapitools:openapi-generator-gradle-plugin:4.1.0') {
|
||||||
exclude group: 'com.google.guava'
|
exclude group: 'com.google.guava'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.2.61'
|
ext.kotlin_version = '1.2.61'
|
||||||
repositories {
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven {
|
maven {
|
||||||
url "https://plugins.gradle.org/m2/"
|
url "https://plugins.gradle.org/m2/"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# RELEASE_VERSION
|
# RELEASE_VERSION
|
||||||
openApiGeneratorVersion=4.1.0-SNAPSHOT
|
openApiGeneratorVersion=4.1.1-SNAPSHOT
|
||||||
# /RELEASE_VERSION
|
# /RELEASE_VERSION
|
||||||
|
|
||||||
# BEGIN placeholders
|
# BEGIN placeholders
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.0-SNAPSHOT</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -17,5 +17,5 @@ gradle generateGoWithInvalidSpec
|
|||||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gradle -PopenApiGeneratorVersion=4.0.3 openApiValidate
|
gradle -PopenApiGeneratorVersion=4.1.0 openApiValidate
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# RELEASE_VERSION
|
# RELEASE_VERSION
|
||||||
openApiGeneratorVersion=4.0.3
|
openApiGeneratorVersion=4.1.0
|
||||||
# /RELEASE_VERSION
|
# /RELEASE_VERSION
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package org.openapitools.generator.gradle.plugin
|
|||||||
import org.gradle.api.Plugin
|
import org.gradle.api.Plugin
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorGenerateExtension
|
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorGenerateExtension
|
||||||
|
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorGeneratorsExtension
|
||||||
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorMetaExtension
|
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorMetaExtension
|
||||||
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorValidateExtension
|
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorValidateExtension
|
||||||
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
|
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
|
||||||
@@ -53,12 +54,20 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
|
|||||||
project
|
project
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val generators = extensions.create(
|
||||||
|
"openApiGenerators",
|
||||||
|
OpenApiGeneratorGeneratorsExtension::class.java,
|
||||||
|
project
|
||||||
|
)
|
||||||
|
|
||||||
generate.outputDir.set("$buildDir/generate-resources/main")
|
generate.outputDir.set("$buildDir/generate-resources/main")
|
||||||
|
|
||||||
tasks.apply {
|
tasks.apply {
|
||||||
create("openApiGenerators", GeneratorsTask::class.java) {
|
create("openApiGenerators", GeneratorsTask::class.java) {
|
||||||
group = pluginGroup
|
group = pluginGroup
|
||||||
description = "Lists generators available via Open API Generators."
|
description = "Lists generators available via Open API Generators."
|
||||||
|
|
||||||
|
include.set(generators.include)
|
||||||
}
|
}
|
||||||
|
|
||||||
create("openApiMeta", MetaTask::class.java) {
|
create("openApiMeta", MetaTask::class.java) {
|
||||||
@@ -99,6 +108,7 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
|
|||||||
instantiationTypes.set(generate.instantiationTypes)
|
instantiationTypes.set(generate.instantiationTypes)
|
||||||
typeMappings.set(generate.typeMappings)
|
typeMappings.set(generate.typeMappings)
|
||||||
additionalProperties.set(generate.additionalProperties)
|
additionalProperties.set(generate.additionalProperties)
|
||||||
|
serverVariables.set(generate.serverVariables)
|
||||||
languageSpecificPrimitives.set(generate.languageSpecificPrimitives)
|
languageSpecificPrimitives.set(generate.languageSpecificPrimitives)
|
||||||
importMappings.set(generate.importMappings)
|
importMappings.set(generate.importMappings)
|
||||||
invokerPackage.set(generate.invokerPackage)
|
invokerPackage.set(generate.invokerPackage)
|
||||||
|
|||||||
@@ -120,6 +120,11 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
|
|||||||
*/
|
*/
|
||||||
val additionalProperties = project.objects.property<Map<String, String>>()
|
val additionalProperties = project.objects.property<Map<String, String>>()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets server variable for server URL template substitution, in the format of name=value,name=value.
|
||||||
|
*/
|
||||||
|
val serverVariables = project.objects.property<Map<String, String>>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
|
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.openapitools.generator.gradle.plugin.extensions
|
||||||
|
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.tasks.Internal
|
||||||
|
import org.gradle.kotlin.dsl.listProperty
|
||||||
|
import org.openapitools.codegen.meta.Stability
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gradle project level extension object definition for the generators task
|
||||||
|
*
|
||||||
|
* @author Jim Schubert
|
||||||
|
*/
|
||||||
|
open class OpenApiGeneratorGeneratorsExtension(project: Project) {
|
||||||
|
/**
|
||||||
|
* A list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default.
|
||||||
|
*/
|
||||||
|
val include = project.objects.listProperty<String>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
applyDefaults()
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
|
fun applyDefaults(){
|
||||||
|
include.set(Stability.values().map { s -> s.value() }.filterNot { it == Stability.DEPRECATED.value() })
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -155,6 +155,13 @@ open class GenerateTask : DefaultTask() {
|
|||||||
@get:Internal
|
@get:Internal
|
||||||
val additionalProperties = project.objects.property<Map<String, String>>()
|
val additionalProperties = project.objects.property<Map<String, String>>()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets server variable for server URL template substitution, in the format of name=value,name=value.
|
||||||
|
* You can also have multiple occurrences of this option.
|
||||||
|
*/
|
||||||
|
@get:Internal
|
||||||
|
val serverVariables = project.objects.property<Map<String, String>>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
|
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
|
||||||
*/
|
*/
|
||||||
@@ -573,6 +580,12 @@ open class GenerateTask : DefaultTask() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (serverVariables.isPresent) {
|
||||||
|
serverVariables.get().forEach { entry ->
|
||||||
|
configurator.addServerVariable(entry.key, entry.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (languageSpecificPrimitives.isPresent) {
|
if (languageSpecificPrimitives.isPresent) {
|
||||||
languageSpecificPrimitives.get().forEach {
|
languageSpecificPrimitives.get().forEach {
|
||||||
configurator.addLanguageSpecificPrimitive(it)
|
configurator.addLanguageSpecificPrimitive(it)
|
||||||
|
|||||||
@@ -17,9 +17,11 @@
|
|||||||
package org.openapitools.generator.gradle.plugin.tasks
|
package org.openapitools.generator.gradle.plugin.tasks
|
||||||
|
|
||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.tasks.Internal
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
import org.gradle.internal.logging.text.StyledTextOutput
|
import org.gradle.internal.logging.text.StyledTextOutput
|
||||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||||
|
import org.gradle.kotlin.dsl.listProperty
|
||||||
import org.openapitools.codegen.CodegenConfigLoader
|
import org.openapitools.codegen.CodegenConfigLoader
|
||||||
import org.openapitools.codegen.CodegenType
|
import org.openapitools.codegen.CodegenType
|
||||||
import org.openapitools.codegen.meta.GeneratorMetadata
|
import org.openapitools.codegen.meta.GeneratorMetadata
|
||||||
@@ -35,6 +37,12 @@ import org.openapitools.codegen.meta.Stability
|
|||||||
* @author Jim Schubert
|
* @author Jim Schubert
|
||||||
*/
|
*/
|
||||||
open class GeneratorsTask : DefaultTask() {
|
open class GeneratorsTask : DefaultTask() {
|
||||||
|
/**
|
||||||
|
* A list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default.
|
||||||
|
*/
|
||||||
|
@get:Internal
|
||||||
|
val include = project.objects.listProperty<String>()
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun doWork() {
|
fun doWork() {
|
||||||
@@ -45,6 +53,15 @@ open class GeneratorsTask : DefaultTask() {
|
|||||||
StringBuilder().apply {
|
StringBuilder().apply {
|
||||||
val types = CodegenType.values()
|
val types = CodegenType.values()
|
||||||
|
|
||||||
|
val stabilities = if (include.isPresent) {
|
||||||
|
when {
|
||||||
|
include.get().contains("all") -> Stability.values().toList()
|
||||||
|
else -> include.get().map { Stability.forDescription(it) }
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Stability.values().filterNot { it == Stability.DEPRECATED }
|
||||||
|
}
|
||||||
|
|
||||||
append("The following generators are available:")
|
append("The following generators are available:")
|
||||||
|
|
||||||
append(System.lineSeparator())
|
append(System.lineSeparator())
|
||||||
@@ -56,21 +73,23 @@ open class GeneratorsTask : DefaultTask() {
|
|||||||
|
|
||||||
generators.filter { it.tag == type }
|
generators.filter { it.tag == type }
|
||||||
.sortedBy { it.name }
|
.sortedBy { it.name }
|
||||||
.forEach({ generator ->
|
.forEach { generator ->
|
||||||
|
|
||||||
val meta: GeneratorMetadata? = generator.generatorMetadata
|
val meta: GeneratorMetadata? = generator.generatorMetadata
|
||||||
|
val include = stabilities.contains(meta?.stability)
|
||||||
|
if (include) {
|
||||||
|
append(" - ")
|
||||||
|
append(generator.name)
|
||||||
|
|
||||||
append(" - ")
|
meta?.stability?.let {
|
||||||
append(generator.name)
|
if (it != Stability.STABLE) {
|
||||||
|
append(" (${it.value()})")
|
||||||
meta?.stability?.let {
|
}
|
||||||
if (it != Stability.STABLE) {
|
|
||||||
append(" (${it.value()})")
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
append(System.lineSeparator())
|
append(System.lineSeparator())
|
||||||
})
|
}
|
||||||
|
}
|
||||||
|
|
||||||
append(System.lineSeparator())
|
append(System.lineSeparator())
|
||||||
append(System.lineSeparator())
|
append(System.lineSeparator())
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.0.3</version>
|
<version>4.1.0</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.0.3</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
@@ -88,6 +88,13 @@
|
|||||||
<version>${jersey-version}</version>
|
<version>${jersey-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- @Nullable annotation -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
|
<artifactId>jsr305</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON processing: jackson -->
|
<!-- JSON processing: jackson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||||
@@ -113,7 +120,12 @@
|
|||||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||||
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
||||||
<version>${jackson-version}</version>
|
<version>${jackson-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Joda time: if you use it -->
|
<!-- Joda time: if you use it -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -139,6 +151,7 @@
|
|||||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||||
<jersey-version>2.27</jersey-version>
|
<jersey-version>2.27</jersey-version>
|
||||||
<jackson-version>2.8.9</jackson-version>
|
<jackson-version>2.8.9</jackson-version>
|
||||||
|
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
|
||||||
<jodatime-version>2.7</jodatime-version>
|
<jodatime-version>2.7</jodatime-version>
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.0.3</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -101,6 +101,13 @@
|
|||||||
<version>${jersey-version}</version>
|
<version>${jersey-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- @Nullable annotation -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
|
<artifactId>jsr305</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON processing: jackson -->
|
<!-- JSON processing: jackson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||||
@@ -126,7 +133,12 @@
|
|||||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||||
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
||||||
<version>${jackson-version}</version>
|
<version>${jackson-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Joda time: if you use it -->
|
<!-- Joda time: if you use it -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||||
<jersey-version>2.27</jersey-version>
|
<jersey-version>2.27</jersey-version>
|
||||||
<jackson-version>2.8.9</jackson-version>
|
<jackson-version>2.8.9</jackson-version>
|
||||||
|
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
|
||||||
<jodatime-version>2.7</jodatime-version>
|
<jodatime-version>2.7</jodatime-version>
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.0.3</version>
|
<version>4.1.0</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.0.3</version>
|
<version>4.1.0</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.0-SNAPSHOT</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -17,19 +17,8 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.plugin;
|
package org.openapitools.codegen.plugin;
|
||||||
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyAdditionalPropertiesKvp;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyImportMappingsKvp;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyInstantiationTypesKvp;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyLanguageSpecificPrimitivesCsv;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyTypeMappingsKvp;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyReservedWordsMappingsKvp;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyAdditionalPropertiesKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyImportMappingsKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyInstantiationTypesKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyLanguageSpecificPrimitivesCsvList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyTypeMappingsKvpList;
|
|
||||||
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.applyReservedWordsMappingsKvpList;
|
|
||||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||||
|
import static org.openapitools.codegen.config.CodegenConfiguratorUtils.*;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -289,6 +278,12 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
@Parameter(name = "additionalProperties", property = "openapi.generator.maven.plugin.additionalProperties")
|
@Parameter(name = "additionalProperties", property = "openapi.generator.maven.plugin.additionalProperties")
|
||||||
private List<String> additionalProperties;
|
private List<String> additionalProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A map of server variable overrides for specs that support server URL templating
|
||||||
|
*/
|
||||||
|
@Parameter(name = "serverVariableOverrides", property = "openapi.generator.maven.plugin.serverVariableOverrides")
|
||||||
|
private List<String> serverVariableOverrides;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of reserved names and how they should be escaped
|
* A map of reserved names and how they should be escaped
|
||||||
*/
|
*/
|
||||||
@@ -615,6 +610,10 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
configurator);
|
configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (serverVariableOverrides == null && configOptions.containsKey("server-variables")) {
|
||||||
|
applyServerVariablesKvp(configOptions.get("server-variables").toString(), configurator);
|
||||||
|
}
|
||||||
|
|
||||||
// Retained for backwards-compataibility with configOptions -> reserved-words-mappings
|
// Retained for backwards-compataibility with configOptions -> reserved-words-mappings
|
||||||
if (reservedWordsMappings == null && configOptions.containsKey("reserved-words-mappings")) {
|
if (reservedWordsMappings == null && configOptions.containsKey("reserved-words-mappings")) {
|
||||||
applyReservedWordsMappingsKvp(configOptions.get("reserved-words-mappings")
|
applyReservedWordsMappingsKvp(configOptions.get("reserved-words-mappings")
|
||||||
@@ -648,6 +647,10 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
|
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (serverVariableOverrides != null && (configOptions == null || !configOptions.containsKey("server-variables"))) {
|
||||||
|
applyServerVariablesKvpList(serverVariableOverrides, configurator);
|
||||||
|
}
|
||||||
|
|
||||||
// Apply Reserved Words Mappings
|
// Apply Reserved Words Mappings
|
||||||
if (reservedWordsMappings != null && (configOptions == null || !configOptions.containsKey("reserved-words-mappings"))) {
|
if (reservedWordsMappings != null && (configOptions == null || !configOptions.containsKey("reserved-words-mappings"))) {
|
||||||
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
|
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.0-SNAPSHOT</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.0-SNAPSHOT</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ public interface CodegenConfig {
|
|||||||
|
|
||||||
Map<String, Object> additionalProperties();
|
Map<String, Object> additionalProperties();
|
||||||
|
|
||||||
|
Map<String, String> serverVariableOverrides();
|
||||||
|
|
||||||
Map<String, Object> vendorExtensions();
|
Map<String, Object> vendorExtensions();
|
||||||
|
|
||||||
String testPackage();
|
String testPackage();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user