diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 78cb721df02..a6064478b97 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -6,5 +6,5 @@
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) before.
- [ ] Run the shell script(s) under `./bin/` (or Windows batch scripts under`.\bin\windows`) to update Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run `./bin/{LANG}-petstore.sh`, `./bin/openapi3/{LANG}-petstore.sh` if updating the code or mustache templates for a language (`{LANG}`) (e.g. php, ruby, python, etc).
-- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `4.1.x`, `5.0.x`. Default: `master`.
+- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `4.3.x`, `5.0.x`. Default: `master`.
- [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.
diff --git a/.travis.yml b/.travis.yml
index 2e034e8a7c8..e7eccb2c0ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -138,6 +138,8 @@ script:
# test maven plugin
- mvn clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml
- mvn clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
+ - mvn clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml
+ - mvn clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml
# test gradle plugin
- (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk)
- (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
diff --git a/CI/.drone.yml b/CI/.drone.yml
index 5a7f9967c36..8594d0b486d 100644
--- a/CI/.drone.yml
+++ b/CI/.drone.yml
@@ -2,6 +2,17 @@ kind: pipeline
name: default
steps:
+# 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
+ - opam pin add ocaml-migrate-parsetree 1.3.1
+ - eval $(opam env)
+ - sudo chmod -R 777 .
+ - dune build --build-dir=./_build
# test haskell client
- name: haskell-client-test
image: haskell:8.6.5
@@ -28,13 +39,3 @@ steps:
- /bin/bash bin/run-all-petstore
# generate all petstore samples (openapi3)
- /bin/bash bin/openapi3/run-all-petstore
-# 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
diff --git a/CI/.travis.yml.ios b/CI/.travis.yml.ios
index c7b653fc15d..8da2e0768d6 100644
--- a/CI/.travis.yml.ios
+++ b/CI/.travis.yml.ios
@@ -1,55 +1,25 @@
sudo: required
language: objective-c
-osx_image: xcode8.1
-cache:
- directories:
- - $HOME/.m2
- - $HOME/.ivy2
- - $HOME/.gradle/caches/
- - $HOME/.gradle/wrapper/
- - $HOME/.stack
- - $HOME/samples/client/petstore/php/OpenAPIToolsClient-php/vendor
- - $HOME/samples/client/petstore/ruby/venodr/bundle
- - $HOME/samples/client/petstore/python/.venv/
- - $HOME/samples/client/petstore/typescript-node/npm/node_modules
- - $HOME/samples/client/petstore/typescript-node/npm/typings/
- - $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules
- - $HOME/samples/client/petstore/typescript-fetch/tests/default/typings
- - $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules
- - $HOME/samples/client/petstore/typescript-fetch/builds/default/typings
- - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules
- - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings
- - $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules
- - $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings
- - $HOME/samples/client/petstore/typescript-angularjs/node_modules
- - $HOME/samples/client/petstore/typescript-angularjs/typings
- - $HOME/.cocoapods/repos/master
- timeout: 1000
-
-# comment out the host table change to use the public petstore server
-addons:
- hosts:
- - petstore.swagger.io
-
+osx_image: xcode10.3
before_install:
- export SW=`pwd`
- rvm list
- - rvm use 2.3.3
+ #- rvm use 2.3.3
- gem environment
- - gem install bundler -N --no-ri --no-rdoc
- - gem install cocoapods -v 1.2.1 -N --no-ri --no-rdoc
- - gem install xcpretty -N --no-ri --no-rdoc
+ - gem install bundler -N
+ - gem install cocoapods -v 1.2.1 -N
+ - gem install xcpretty -N
- pod --version
# comment out below to avoid errors
#- pod repo update
- - pod setup --silent > /dev/null
- - mkdir -p ~/.local/bin
- - export PATH=$HOME/.local/bin:$PATH
- # start local petstore server
- - git clone -b docker --single-branch https://github.com/wing328/swagger-samples
- - cd swagger-samples/java/java-jersey-jaxrs
- - sudo mvn jetty:run &
- - cd $SW
+ #- pod setup --silent > /dev/null
+ #- mkdir -p ~/.local/bin
+ #- export PATH=$HOME/.local/bin:$PATH
+ ## start local petstore server
+ #- git clone -b docker --single-branch https://github.com/wing328/swagger-samples
+ #- cd swagger-samples/java/java-jersey-jaxrs
+ #- sudo mvn jetty:run &
+ #- cd $SW
# show host table to confirm petstore.swagger.io is mapped to localhost
- cat /etc/hosts
@@ -64,4 +34,4 @@ before_install:
script:
# run integration tests defined in maven pom.xml
- - mvn -q --batch-mode verify -Psamples
+ - mvn -q --batch-mode verify -Psamples.ios -Dmaven.javadoc.skip=true
diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh
index b7142b28a9d..504a4384133 100755
--- a/CI/circle_parallel.sh
+++ b/CI/circle_parallel.sh
@@ -28,7 +28,7 @@ elif [ "$NODE_INDEX" = "2" ]; then
git checkout -- .
# look for outdated samples
- ./bin/utils/ensure-up-to-date
+ ./bin/utils/ensure-up-to-date --batch
fi
#elif [ "$NODE_INDEX" = "3" ]; then
echo "Running node $NODE_INDEX to test haskell"
diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java
index 2b32dccf324..a3febe1fba1 100644
--- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java
+++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java
@@ -128,8 +128,6 @@ public class PetApiTest {
//empty
}
});
- // the API call should be executed asynchronously, so result should be empty at the moment
- assertTrue(result.isEmpty());
// wait for the asynchronous call to finish (at most 10 seconds)
final int maxTry = 10;
diff --git a/README.md b/README.md
index 6e781a7e585..ddf1e8abaf0 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,18 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.1-SNAPSHOT`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
+[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.2-SNAPSHOT`): [](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)
+[`4.3.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.3.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)
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
@@ -103,8 +109,8 @@ 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)
4.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.3.0-SNAPSHOT/)| 29.02.2020 | Minor release (breaking changes with fallbacks)
-4.2.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.1-SNAPSHOT/)| 15.11.2019 | Patch release
-[4.2.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.0) (latest stable release) | 31.10.2019 | Minor release (bug fixes, enhancements, breaking chanages with fallbacks)
+4.2.2-SNAPSHOT (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.2-SNAPSHOT/)| 02.12.2019 | Patch release
+[4.2.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.1) (latest stable release) | 15.11.2019 | Patch release
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
@@ -160,16 +166,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
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.2.0/openapi-generator-cli-4.2.0.jar`
+JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar`
For **Mac/Linux** users:
```sh
-wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.0/openapi-generator-cli-4.2.0.jar -O openapi-generator-cli.jar
+wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.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.
```
-Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.0/openapi-generator-cli-4.2.0.jar
+Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -384,10 +390,10 @@ openapi-generator version
```
-Or install a particular OpenAPI Generator version (e.g. v4.2.0):
+Or install a particular OpenAPI Generator version (e.g. v4.1.2):
```sh
-npm install @openapitools/openapi-generator-cli@cli-4.2.0 -g
+npm install @openapitools/openapi-generator-cli@cli-4.1.2 -g
```
Or install it as dev-dependency:
@@ -411,7 +417,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`)
-You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.0/openapi-generator-cli-4.2.0.jar)
+You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar)
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
@@ -516,7 +522,7 @@ Please refer to [customization.md](docs/customization.md) on how to customize th
### [3.2 - Workflow Integration (Maven, Gradle, Github, CI/CD)](#table-of-contents)
-Please refer to [integration.md](docs/integration.md) on how to integrate OpenAPI generator with Maven, Gradle, Github and CI/CD.
+Please refer to [integration.md](docs/integration.md) on how to integrate OpenAPI generator with Maven, Gradle, sbt, Bazel, Github and CI/CD.
### [3.3 - Online OpenAPI generator](#table-of-contents)
@@ -578,15 +584,18 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Element AI](https://www.elementai.com/)
- [Fenergo](https://www.fenergo.com/)
- [FormAPI](https://formapi.io/)
+- [FreshCells](https://www.freshcells.de/)
- [Fuse](https://www.fuse.no/)
- [Gantner](https://www.gantner.com)
- [GenFlow](https://github.com/RepreZen/GenFlow)
+- [GetYourGuide](https://www.getyourguide.com/)
- [GMO Pepabo](https://pepabo.com/en/)
- [GoDaddy](https://godaddy.com)
- [Here](https://developer.here.com/)
- [IBM](https://www.ibm.com/)
- [JustStar](https://www.juststarinfo.com)
- [Klarna](https://www.klarna.com/)
+- [Kronsoft Development](https://www.kronsoft.ro/home/)
- [Médiavision](https://www.mediavision.fr/)
- [Metaswitch](https://www.metaswitch.com/)
- [Myworkout](https://myworkout.com)
@@ -596,6 +605,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Ponicode](https://ponicode.dev/)
- [Pricefx](https://www.pricefx.com/)
- [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager)
+- [QEDIT](https://qed-it.com)
+- [Qulix Systems](https://www.qulix.com)
- [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch)
- [RedHat](https://www.redhat.com)
- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)
@@ -678,6 +689,12 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2019-10-16 - [How to ship APIs faster?](https://medium.com/@accounts_76224/how-to-ship-apis-faster-cabef2f819e4) by [Simon Guilliams @ PoniCode](https://ponicode.dev)
- 2019-10-22 - [OpenAPI + Spring Boot(Kotlin)でファイルダウンロードAPIを作成する](https://qiita.com/boronngo/items/4b78b92526209daeaee9) by [Yuki Furukawa](https://twitter.com/yuki_furukawa5)
- 2019-10-24 - [Microprofile OpenAPI - Code First or Design First?](https://github.com/pe-st/apidocs/blob/master/MicroProfile-OpenAPI-all-slides.pdf) by [Peter [pɛʃə] Steiner](https://twitter.com/pesche) at [eclipsecon Europe 2019](https://www.eclipsecon.org/europe2019/sessions/microprofile-openapi-code-first-or-design-first)
+- 2019-11-06 - [Generating API clients based on OpenAPI v3 specifications](https://98elements.com/blog/generating-api-clients-based-on-openapi-v3-specifications) by [Dominik Jastrzębski @ 98elements](https://98elements.com)
+- 2019-11-06 - [OpenAPIを利用して自前のAPIサーバー(Sinatra)を移植した時のメモ](https://qiita.com/YasuhiroABE/items/c73920eab2d9d6e97fd9) by [Yasuhiro ABE](https://twitter.com/YasuhiroABE)
+- 2019-11-07 - [API First development with OpenAPI - You should you practise it !?](https://www.youtube.com/watch?v=F9iF3a1Z8Y8) by [Nick Van Hoof](https://www.nickvanhoof.com/) at [Devoxx Belgium 2019](https://devoxx.be/)
+- 2019-11-08 - [JHipster beyond CRUD - API-First for Enterprises by Enrico Costanzi](https://www.youtube.com/watch?v=m28JFovKQ20) by [Enrico Costanzi](https://twitter.com/enricocostanzi) at [JHipster Conf 2019 in Paris](https://jhipster-conf.github.io/)
+- 2019-11-11 - [TypeScript REST APIクライアント](https://qiita.com/unhurried/items/7b74f7d3c43545dadd2b) by [@unhurried](https://qiita.com/unhurried)
+- 2019-11-11 - [One Spec to Rule them all - OpenAPI in Action](https://www.youtube.com/watch?v=MMay_nht8ec) by [Andreas Litt](https://github.com/littldr) at [code.talks 2019](https://www.codetalks.com/)
## [6 - About Us](#table-of-contents)
@@ -871,7 +888,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Groovy | |
| Haskell | |
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) |
-| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) |
+| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) |
| Lua | @daurnimator (2017/08) |
| Nim | |
| NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) |
@@ -880,7 +897,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| 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) |
| PowerShell | |
-| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) |
+| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) @spacether (2019/11)|
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) |
diff --git a/bin/ci/php-symfony-petstore.json b/bin/ci/php-symfony-petstore.json
index 81f5f6296b0..8af199acbc5 100644
--- a/bin/ci/php-symfony-petstore.json
+++ b/bin/ci/php-symfony-petstore.json
@@ -1,6 +1,6 @@
{
"generatorName": "php-symfony",
- "inputSpec": "/Users/jim/projects/openapi-generator/bin/../modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
- "outputDir": "/Users/jim/projects/openapi-generator/bin/../samples/server/petstore/php-symfony/SymfonyBundle-php",
- "templateDir": "/Users/jim/projects/openapi-generator/bin/../modules/openapi-generator/src/main/resources/php-symfony"
+ "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
+ "outputDir": "samples/server/petstore/php-symfony/SymfonyBundle-php",
+ "templateDir": "modules/openapi-generator/src/main/resources/php-symfony"
}
\ No newline at end of file
diff --git a/bin/ci/python-experimental.json b/bin/ci/python-experimental.json
new file mode 100644
index 00000000000..d9f6d70db22
--- /dev/null
+++ b/bin/ci/python-experimental.json
@@ -0,0 +1,9 @@
+{
+ "generatorName": "python-experimental",
+ "inputSpec": "modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml",
+ "outputDir": "samples/client/petstore/python-experimental",
+ "templateDir": "modules/openapi-generator/src/main/resources/python",
+ "additionalProperties": {
+ "packageName": "petstore_api"
+ }
+}
\ No newline at end of file
diff --git a/bin/ci/spring-petstore-8.json b/bin/ci/spring-petstore-8.json
index d275fbabac9..840e4fa8c4a 100644
--- a/bin/ci/spring-petstore-8.json
+++ b/bin/ci/spring-petstore-8.json
@@ -5,6 +5,7 @@
"outputDir": "samples/server/petstore/springboot",
"templateDir": "modules/openapi-generator/src/main/resources/JavaSpring",
"additionalProperties": {
- "hideGenerationTimestamp": true
+ "hideGenerationTimestamp": true,
+ "snapshotVersion": true
}
}
\ No newline at end of file
diff --git a/bin/cpp-qt5-petstore.json b/bin/cpp-qt5-petstore.json
new file mode 100644
index 00000000000..b27f55f17f8
--- /dev/null
+++ b/bin/cpp-qt5-petstore.json
@@ -0,0 +1,8 @@
+{
+ "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
+ "outputDir": "samples/client/petstore/cpp-qt5",
+ "additionalProperties": {
+ "cppNamespace": "test_namespace",
+ "modelNamePrefix": "PFX"
+ }
+}
diff --git a/bin/cpp-qt5-petstore.sh b/bin/cpp-qt5-petstore.sh
index ee4f3111997..f870163d69a 100755
--- a/bin/cpp-qt5-petstore.sh
+++ b/bin/cpp-qt5-petstore.sh
@@ -27,6 +27,10 @@ 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/cpp-qt5-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5-client -o samples/client/petstore/cpp-qt5 $@"
+args="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client \
+ -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
+ -g cpp-qt5-client \
+ -c cpp-qt5-petstore.json \
+ $@"
-java $JAVA_OPTS -jar $executable $ags
+java $JAVA_OPTS -jar $executable $args
diff --git a/bin/kotlin-client-all.sh b/bin/kotlin-client-all.sh
index 175752d797f..f2ff479cb03 100755
--- a/bin/kotlin-client-all.sh
+++ b/bin/kotlin-client-all.sh
@@ -1,8 +1,10 @@
#!/bin/sh
+./bin/kotlin-client-gson.sh
./bin/kotlin-client-nonpublic.sh
./bin/kotlin-client-okhttp3.sh
./bin/kotlin-client-petstore-multiplatform.sh
./bin/kotlin-client-petstore.sh
./bin/kotlin-client-string.sh
./bin/kotlin-client-threetenbp.sh
+./bin/kotlin-client-nullable.sh
diff --git a/bin/kotlin-client-gson.sh b/bin/kotlin-client-gson.sh
new file mode 100755
index 00000000000..f178cb88038
--- /dev/null
+++ b/bin/kotlin-client-gson.sh
@@ -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/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-gson --additional-properties serializationLibrary=gson -o samples/client/petstore/kotlin-gson $@"
+
+java ${JAVA_OPTS} -jar ${executable} ${ags}
diff --git a/bin/kotlin-client-nonpublic.sh b/bin/kotlin-client-nonpublic.sh
index 620a6fe3c8c..16c366ef673 100755
--- a/bin/kotlin-client-nonpublic.sh
+++ b/bin/kotlin-client-nonpublic.sh
@@ -30,5 +30,3 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-nonpublic --additional-properties nonPublicApi=true -o samples/client/petstore/kotlin-nonpublic $@"
java ${JAVA_OPTS} -jar ${executable} ${ags}
-
-cp CI/samples.ci/client/petstore/kotlin-string/pom.xml samples/client/petstore/kotlin-string/pom.xml
diff --git a/bin/kotlin-client-nullable.sh b/bin/kotlin-client-nullable.sh
new file mode 100755
index 00000000000..aaa3ae06f41
--- /dev/null
+++ b/bin/kotlin-client-nullable.sh
@@ -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/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-nullable --additional-properties nullableReturnType=true,serializableModel=true -o samples/client/petstore/kotlin-nullable $@"
+
+java ${JAVA_OPTS} -jar ${executable} ${ags}
diff --git a/bin/kotlin-client-okhttp3.sh b/bin/kotlin-client-okhttp3.sh
index c2fbb300874..3f1cc101700 100755
--- a/bin/kotlin-client-okhttp3.sh
+++ b/bin/kotlin-client-okhttp3.sh
@@ -30,5 +30,3 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-okhttp3 --library jvm-okhttp3 -o samples/client/petstore/kotlin-okhttp3 $@"
java ${JAVA_OPTS} -jar ${executable} ${ags}
-
-#cp CI/samples.ci/client/petstore/kotlin-okhttp3/pom.xml samples/client/petstore/kotlin-okhttp3/pom.xml
diff --git a/bin/meta-codegen-kotlin.sh b/bin/meta-codegen-kotlin.sh
new file mode 100755
index 00000000000..347d8f76144
--- /dev/null
+++ b/bin/meta-codegen-kotlin.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+SCRIPT="$0"
+echo "# START SCRIPT: $SCRIPT"
+
+declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+declare root="$(cd "$cwd" && cd ../ && pwd)"
+
+if ! command -v gradle > /dev/null; then
+ echo "[WARN] This script requires a system gradle to be installed. Not treating this as an error."
+ exit 0
+fi
+
+executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar"
+
+if [ ! -f "$executable" ]
+then
+ (cd "$root" && ./mvnw -B clean package)
+fi
+
+\rm -rf "${root}/samples/meta-codegen-kotlin/lib"
+
+export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
+ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o samples/meta-codegen-kotlin/lib -l kotlin $@"
+
+java $JAVA_OPTS -jar $executable $ags
+
+if [ ! -f "${root}"samples/meta-codegen-kotlin/gradle/wrapper/gradle-wrapper.jar ]; then
+ (cd "${root}"/samples/meta-codegen-kotlin/ && gradle wrapper --gradle-version 5.6.2 --distribution-type bin)
+fi
+
+
+(cp "${root}"/samples/meta-codegen-kotlin/gradlew "${root}"/samples/meta-codegen-kotlin/lib/ && \
+ cp -R "${root}"/samples/meta-codegen-kotlin/gradle "${root}"/samples/meta-codegen-kotlin/lib/ && \
+ cd "${root}"/samples/meta-codegen-kotlin/lib && \
+ ./gradlew shadowJar)
+
+ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen-kotlin/usage $@"
+
+java $JAVA_OPTS -cp ${root}/samples/meta-codegen-kotlin/lib/build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2
diff --git a/bin/meta-codegen.sh b/bin/meta-codegen.sh
index 2c36acc1400..f45875ea3ae 100755
--- a/bin/meta-codegen.sh
+++ b/bin/meta-codegen.sh
@@ -1,28 +1,15 @@
-#!/bin/sh
+#!/usr/bin/env bash
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
+declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+declare root="$(cd "$cwd" && cd ../ && pwd)"
-if [ ! -d "${APP_DIR}" ]; then
- APP_DIR=`dirname "$SCRIPT"`/..
- APP_DIR=`cd "${APP_DIR}"; pwd`
-fi
+executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar"
-executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
-
-if [ ! -f "$executable" ]
-then
- ./mvnw -B clean package
+if [ ! -f "$executable" ]; then
+ (cd "$root" && ./mvnw -B clean package)
fi
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
@@ -30,8 +17,8 @@ ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o sampl
java $JAVA_OPTS -jar $executable $ags
-./mvnw clean package -f samples/meta-codegen/pom.xml
+(cd "$root" && ./mvnw clean package -f samples/meta-codegen/pom.xml)
ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen/usage $@"
-java $JAVA_OPTS -cp samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2
+java $JAVA_OPTS -cp ${root}/samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2
diff --git a/bin/openapi3/elm-all.sh b/bin/openapi3/elm-all.sh
new file mode 100755
index 00000000000..199d1182de2
--- /dev/null
+++ b/bin/openapi3/elm-all.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./bin/openapi3/elm-petstore.sh
+./bin/openapi3/elm-composition.sh
+
diff --git a/bin/openapi3/elm-composition.sh b/bin/openapi3/elm-composition.sh
new file mode 100755
index 00000000000..97ad1649502
--- /dev/null
+++ b/bin/openapi3/elm-composition.sh
@@ -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
+
+# auto format elm code using elm-format
+export ELM_POST_PROCESS_FILE="/usr/bin/env elm-format --elm-version=0.19 --yes"
+
+# 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/3_0/composition.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/openapi3/client/composition/elm --enable-post-process-file $@"
+
+java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/python-petstore-all.sh b/bin/python-petstore-all.sh
index 1efab14e6e9..86c179eaa0d 100755
--- a/bin/python-petstore-all.sh
+++ b/bin/python-petstore-all.sh
@@ -3,4 +3,5 @@
./bin/python-asyncio-petstore.sh
./bin/python-petstore.sh
+./bin/python-experimental-petstore.sh
./bin/python-tornado-petstore.sh
diff --git a/bin/springboot-petstore-server.sh b/bin/springboot-petstore-server.sh
index 9b34934163d..b1f408e5f3e 100755
--- a/bin/springboot-petstore-server.sh
+++ b/bin/springboot-petstore-server.sh
@@ -27,7 +27,7 @@ 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 --artifact-id springboot -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot --additional-properties hideGenerationTimestamp=true $@"
+ags="generate --artifact-id springboot -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot --additional-properties hideGenerationTimestamp=true,snapshotVersion=true $@"
echo "Removing files and folders under samples/server/petstore/springboot/src/main"
rm -rf samples/server/petstore/springboot/src/main
diff --git a/bin/typescript-angular-petstore-all.sh b/bin/typescript-angular-petstore-all.sh
index bdcd3cdc959..fb3e9b7ef36 100755
--- a/bin/typescript-angular-petstore-all.sh
+++ b/bin/typescript-angular-petstore-all.sh
@@ -15,3 +15,4 @@
./bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh
./bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh
./bin/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.sh
+./bin/typescript-angular-v8-petstore-single-request-parameter.sh
diff --git a/bin/typescript-angular-v8-petstore-single-request-parameter.sh b/bin/typescript-angular-v8-petstore-single-request-parameter.sh
new file mode 100755
index 00000000000..9f25d467d21
--- /dev/null
+++ b/bin/typescript-angular-v8-petstore-single-request-parameter.sh
@@ -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/single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true $@"
+
+java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/utils/dart-keywords/README.md b/bin/utils/dart-keywords/README.md
new file mode 100644
index 00000000000..29b85bfae92
--- /dev/null
+++ b/bin/utils/dart-keywords/README.md
@@ -0,0 +1,20 @@
+
+## What is the purpose?
+
+Running `./save_dart_keywords.sh` from this directory will generate `dart-keywords.txt` which contains the current Dart keywords and is used by the dart generator as a set of reserved words.
+
+## When should the keywords be generated?
+
+`save_dart_keywords.sh` should be run when a new version of Dart is release to update the keywords file.
+
+The last Dart version that was used to generate the keywords can be found in `dart-version.txt`.
+
+## What does the shellscript do?
+
+1. compile a dart app
+ - `dart2native save-dart-keywords.dart`
+
+1. run the dart app
+ - `./save-dart-keywords.exe`
+
+1. the ouput is `dart-keywords.txt` and `dart-version.txt`
diff --git a/bin/utils/dart-keywords/dart-version.txt b/bin/utils/dart-keywords/dart-version.txt
new file mode 100644
index 00000000000..81b2d0d2cd6
--- /dev/null
+++ b/bin/utils/dart-keywords/dart-version.txt
@@ -0,0 +1 @@
+Dart VM version: 2.7.0-dev.0.0 (Tue Nov 5 12:57:33 2019 +0100) on "macos_x64"
diff --git a/bin/utils/dart-keywords/pubspec.lock b/bin/utils/dart-keywords/pubspec.lock
new file mode 100644
index 00000000000..f01fb3f2efb
--- /dev/null
+++ b/bin/utils/dart-keywords/pubspec.lock
@@ -0,0 +1,194 @@
+# Generated by pub
+# See https://dart.dev/tools/pub/glossary#lockfile
+packages:
+ _fe_analyzer_shared:
+ dependency: transitive
+ description:
+ name: _fe_analyzer_shared
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.0"
+ analyzer:
+ dependency: "direct main"
+ description:
+ name: analyzer
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.39.1"
+ args:
+ dependency: transitive
+ description:
+ name: args
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.2"
+ async:
+ dependency: transitive
+ description:
+ name: async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.4.0"
+ charcode:
+ dependency: transitive
+ description:
+ name: charcode
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.2"
+ collection:
+ dependency: transitive
+ description:
+ name: collection
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.14.12"
+ convert:
+ dependency: transitive
+ description:
+ name: convert
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.1"
+ crypto:
+ dependency: transitive
+ description:
+ name: crypto
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.3"
+ csslib:
+ dependency: transitive
+ description:
+ name: csslib
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.16.1"
+ front_end:
+ dependency: transitive
+ description:
+ name: front_end
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.1.29"
+ glob:
+ dependency: transitive
+ description:
+ name: glob
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0"
+ html:
+ dependency: transitive
+ description:
+ name: html
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.14.0+3"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.1+1"
+ kernel:
+ dependency: transitive
+ description:
+ name: kernel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.29"
+ meta:
+ dependency: transitive
+ description:
+ name: meta
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.8"
+ node_interop:
+ dependency: transitive
+ description:
+ name: node_interop
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.3"
+ node_io:
+ dependency: transitive
+ description:
+ name: node_io
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.1+2"
+ package_config:
+ dependency: transitive
+ description:
+ name: package_config
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ path:
+ dependency: transitive
+ description:
+ name: path
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.6.4"
+ pedantic:
+ dependency: transitive
+ description:
+ name: pedantic
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.8.0+1"
+ pub_semver:
+ dependency: transitive
+ description:
+ name: pub_semver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.4.2"
+ source_span:
+ dependency: transitive
+ description:
+ name: source_span
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.5"
+ string_scanner:
+ dependency: transitive
+ description:
+ name: string_scanner
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.5"
+ term_glyph:
+ dependency: transitive
+ description:
+ name: term_glyph
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ typed_data:
+ dependency: transitive
+ description:
+ name: typed_data
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.6"
+ watcher:
+ dependency: transitive
+ description:
+ name: watcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.9.7+12"
+ yaml:
+ dependency: transitive
+ description:
+ name: yaml
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.0"
+sdks:
+ dart: ">=2.6.0 <3.0.0"
diff --git a/bin/utils/dart-keywords/pubspec.yaml b/bin/utils/dart-keywords/pubspec.yaml
new file mode 100644
index 00000000000..addb9924168
--- /dev/null
+++ b/bin/utils/dart-keywords/pubspec.yaml
@@ -0,0 +1,10 @@
+name: dart_keywords
+description: Use the Dart SDK to generate Dart keywords.
+
+version: 1.0.0+1
+
+environment:
+ sdk: ">=2.6.0 <3.0.0"
+
+dependencies:
+ analyzer:
diff --git a/bin/utils/dart-keywords/save-dart-keywords.dart b/bin/utils/dart-keywords/save-dart-keywords.dart
new file mode 100644
index 00000000000..4ad6908a3d5
--- /dev/null
+++ b/bin/utils/dart-keywords/save-dart-keywords.dart
@@ -0,0 +1,16 @@
+import 'dart:io';
+
+import 'package:analyzer/dart/ast/token.dart';
+
+main() {
+ // save keywords to a text file
+ final txtFile = File(
+ '../../../modules/openapi-generator/src/main/resources/dart/dart-keywords.txt');
+ String txtString = '';
+ for (String keyword in Keyword.keywords.keys.toList()) {
+ txtString += keyword + '\n';
+ }
+ txtString =
+ txtString.substring(0, txtString.length - 1); // remove last newline
+ txtFile.writeAsStringSync(txtString);
+}
diff --git a/bin/utils/dart-keywords/save_dart_keywords.sh b/bin/utils/dart-keywords/save_dart_keywords.sh
new file mode 100755
index 00000000000..4211200c8e5
--- /dev/null
+++ b/bin/utils/dart-keywords/save_dart_keywords.sh
@@ -0,0 +1,3 @@
+dart2native save-dart-keywords.dart
+./save-dart-keywords.exe
+dart --version &> dart-version.txt
\ No newline at end of file
diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date
index f97dd12b8fe..f1ee2f60718 100755
--- a/bin/utils/ensure-up-to-date
+++ b/bin/utils/ensure-up-to-date
@@ -1,92 +1,121 @@
-#!/bin/bash
-# this bash script run the scripts for the 'mature' generators
+#!/usr/bin/env bash
+# this bash script runs the scripts for the 'mature' generators by default.
+# Supports --batch option which will compile all generators defined under bin/ci/*.json
# it ensures that all changes are committed into the 'samples/' folder
+# shellcheck disable=SC2155
+declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+declare root="$(cd "$cwd" && cd ../../ && pwd)"
+declare executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar"
+declare batch_mode="false"
echo "# START SCRIPT: $0"
echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) to ensure that the 'samples/' folder is up to date."
+if [ "--batch" = "$1" ]; then
+ batch_mode="true"
+ echo "Running in 'batch mode' (single JVM, mutliple threads)."
+else
+ echo "When running locally execute with argument --batch."
+fi
echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
sleep 5
-# LIST OF SCRIPTS:
-declare -a scripts=(
-# SAMPLES
-"./bin/ruby-client-petstore.sh"
-"./bin/ruby-client-petstore-faraday.sh"
-"./bin/openapi3/ruby-client-petstore.sh"
-"./bin/openapi3/ruby-client-faraday-petstore.sh"
+declare -a samples=(
+"${root}/bin/ruby-client-petstore.sh"
+"${root}/bin/ruby-client-petstore-faraday.sh"
+"${root}/bin/openapi3/ruby-client-petstore.sh"
+"${root}/bin/openapi3/ruby-client-faraday-petstore.sh"
+"${root}/bin/java-petstore-all.sh"
+"${root}/bin/java-jaxrs-petstore-server-all.sh"
+"${root}/bin/java-msf4j-petstore-server.sh"
+"${root}/bin/openapi3/jaxrs-jersey-petstore.sh"
+"${root}/bin/spring-all-petstore.sh"
+"${root}/bin/javascript-petstore-all.sh"
+"${root}/bin/kotlin-client-all.sh"
+"${root}/bin/kotlin-server-petstore.sh"
+"${root}/bin/kotlin-springboot-petstore-server.sh"
+"${root}/bin/kotlin-springboot-petstore-server-reactive.sh"
+"${root}/bin/mysql-schema-petstore.sh"
+"${root}/bin/nim-client-petstore.sh"
+"${root}/bin/python-petstore-all.sh"
+"${root}/bin/openapi3/python-petstore.sh"
+"${root}/bin/php-petstore.sh"
+"${root}/bin/php-silex-petstore-server.sh"
+"${root}/bin/php-symfony-petstore.sh"
+"${root}/bin/php-lumen-petstore-server.sh"
+"${root}/bin/php-slim-server-petstore.sh"
+"${root}/bin/php-slim4-server-petstore.sh"
+"${root}/bin/php-ze-ph-petstore-server.sh"
+"${root}/bin/openapi3/php-petstore.sh"
+"${root}/bin/typescript-angularjs-petstore.sh"
+"${root}/bin/typescript-angular-petstore-all.sh"
+"${root}/bin/typescript-aurelia-petstore.sh"
+"${root}/bin/typescript-axios-petstore-all.sh"
+"${root}/bin/typescript-fetch-petstore-all.sh"
+"${root}/bin/typescript-inversify-petstore.sh"
+"${root}/bin/typescript-jquery-petstore-all.sh"
+"${root}/bin/typescript-node-petstore-all.sh"
+"${root}/bin/typescript-rxjs-petstore-all.sh"
+"${root}/bin/rust-server-petstore.sh"
+"${root}/bin/r-petstore.sh"
+"${root}/bin/haskell-http-client-petstore.sh"
+"${root}/bin/csharp-petstore.sh"
+"${root}/bin/csharp-netcore-petstore-all.sh"
+"${root}/bin/elixir-petstore.sh"
+"${root}/bin/openapi3/go-petstore.sh"
+"${root}/bin/go-experimental-petstore.sh"
+"${root}/bin/go-petstore.sh"
+"${root}/bin/go-petstore-withxml.sh"
+"${root}/bin/go-petstore-server.sh"
+"${root}/bin/go-gin-petstore-server.sh"
+"${root}/bin/groovy-petstore.sh"
+"${root}/bin/apex-petstore.sh"
+"${root}/bin/perl-petstore-all.sh"
+"${root}/bin/dart-jaguar-petstore.sh"
+#"${root}/bin/dart-dio-petstore.sh"
+"${root}/bin/dart-petstore.sh"
+"${root}/bin/dart2-petstore.sh"
+"${root}/bin/java-play-framework-petstore-server-all.sh"
+#"${root}/bin/elm-petstore-all.sh"
+)
-"./bin/java-petstore-all.sh"
-"./bin/java-jaxrs-petstore-server-all.sh"
-"./bin/java-msf4j-petstore-server.sh"
-"./bin/openapi3/jaxrs-jersey-petstore.sh"
-"./bin/spring-all-petstore.sh"
-"./bin/javascript-petstore-all.sh"
-"./bin/kotlin-client-petstore-multiplatform.sh"
-"./bin/kotlin-client-petstore.sh"
-"./bin/kotlin-client-string.sh"
-"./bin/kotlin-client-threetenbp.sh"
-"./bin/kotlin-server-petstore.sh"
-"./bin/kotlin-springboot-petstore-server.sh"
-"./bin/kotlin-springboot-petstore-server-reactive.sh"
-"./bin/mysql-schema-petstore.sh"
-"./bin/nim-client-petstore.sh"
-"./bin/python-petstore-all.sh"
-"./bin/openapi3/python-petstore.sh"
-"./bin/php-petstore.sh"
-"./bin/php-silex-petstore-server.sh"
-"./bin/php-symfony-petstore.sh"
-"./bin/php-lumen-petstore-server.sh"
-"./bin/php-slim-server-petstore.sh"
-"./bin/php-slim4-server-petstore.sh"
-"./bin/php-ze-ph-petstore-server.sh"
-"./bin/openapi3/php-petstore.sh"
-"./bin/typescript-angularjs-petstore.sh"
-"./bin/typescript-angular-petstore-all.sh"
-"./bin/typescript-aurelia-petstore.sh"
-"./bin/typescript-axios-petstore-all.sh"
-"./bin/typescript-fetch-petstore-all.sh"
-"./bin/typescript-inversify-petstore.sh"
-"./bin/typescript-jquery-petstore-all.sh"
-"./bin/typescript-node-petstore-all.sh"
-"./bin/typescript-rxjs-petstore-all.sh"
-"./bin/rust-server-petstore.sh"
-"./bin/r-petstore.sh"
-"./bin/haskell-http-client-petstore.sh"
-"./bin/csharp-petstore.sh"
-"./bin/csharp-netcore-petstore-all.sh"
-"./bin/elixir-petstore.sh"
-"./bin/openapi3/go-petstore.sh"
-"./bin/go-experimental-petstore.sh"
-"./bin/go-petstore.sh"
-"./bin/go-petstore-withxml.sh"
-"./bin/go-petstore-server.sh"
-"./bin/go-gin-petstore-server.sh"
-"./bin/groovy-petstore.sh"
-"./bin/apex-petstore.sh"
-"./bin/perl-petstore-all.sh"
-"./bin/dart-jaguar-petstore.sh"
-#"./bin/dart-dio-petstore.sh"
-"./bin/dart-petstore.sh"
-"./bin/dart2-petstore.sh"
-"./bin/java-play-framework-petstore-server-all.sh"
-"./bin/elm-petstore-all.sh"
-"./bin/meta-codegen.sh"
-# OTHERS
-"./bin/utils/export_docs_generators.sh"
-"./bin/utils/copy-to-website.sh"
-"./bin/utils/export_generators_readme.sh")
+# Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath)
+# Docs should always be run, regardless of batch or operation.
+declare -a always_iterate=(
+"${root}/bin/meta-codegen.sh"
+"${root}/bin/utils/export_docs_generators.sh"
+"${root}/bin/utils/copy-to-website.sh"
+"${root}/bin/utils/export_generators_readme.sh"
+)
-export JAVA_OPTS="-Djava.awt.headless=true"
+export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
-for script in "${scripts[@]}"; do
- if eval $script > /dev/null 2>&1; then
- echo "Executed $script successfully!"
- else
- echo "ERROR: Failed to run $script"
- exit 1
+if [ "true" = "$batch_mode" ]; then
+ if [ ! -f "$executable" ]; then
+ (cd "${root}" && mvn -B clean package -DskipTests=true -Dmaven.javadoc.skip=true)
fi
+
+ # shellcheck disable=SC2086
+ java $JAVA_OPTS -jar "$executable" batch --includes-base-dir "${root}" --fail-fast -- "${root}"/bin/ci/*
+else
+ for script in "${samples[@]}"; do
+ if eval "$script" > /dev/null 2>&1; then
+ echo "Executed $script successfully!"
+ else
+ echo "ERROR: Failed to run $script"
+ exit 1
+ fi
+ done
+fi
+
+for i in "${always_iterate[@]}"; do
+ if eval "$i" > /dev/null 2>&1; then
+ echo "Executed $i successfully!"
+ else
+ echo "ERROR: Failed to run $i"
+ exit 1
+ fi
done
# Check:
@@ -102,3 +131,4 @@ if [ -n "$(git status --porcelain)" ]; then
else
echo "Git working tree is clean"
fi
+
diff --git a/bin/windows/kotlin-client-all.bat b/bin/windows/kotlin-client-all.bat
new file mode 100644
index 00000000000..8a1b70a36e7
--- /dev/null
+++ b/bin/windows/kotlin-client-all.bat
@@ -0,0 +1,8 @@
+call powershell -command "& '%~dp0\kotlin-client-gson.bat'"
+call powershell -command "& '%~dp0\kotlin-client-nonpublic.bat'"
+call powershell -command "& '%~dp0\kotlin-client-okhttp3.bat'"
+call powershell -command "& '%~dp0\kotlin-client-petstore-multiplatform.bat'"
+call powershell -command "& '%~dp0\kotlin-client-petstore.bat'"
+call powershell -command "& '%~dp0\kotlin-client-string.bat'"
+call powershell -command "& '%~dp0\kotlin-client-threetenbp.bat'"
+call powershell -command "& '%~dp0\kotlin-client-nullable.bat'"
\ No newline at end of file
diff --git a/bin/windows/kotlin-client-gson.bat b/bin/windows/kotlin-client-gson.bat
new file mode 100644
index 00000000000..30eeaf423f7
--- /dev/null
+++ b/bin/windows/kotlin-client-gson.bat
@@ -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 --artifact-id "kotlin-petstore-gson" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --additional-properties serializationLibrary=gson -o samples\client\petstore\kotlin-gson
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/kotlin-client-nonpublic.bat b/bin/windows/kotlin-client-nonpublic.bat
new file mode 100644
index 00000000000..899d4318060
--- /dev/null
+++ b/bin/windows/kotlin-client-nonpublic.bat
@@ -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 --artifact-id "kotlin-petstore-nonpublic" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --additional-properties nonPublicApi=true -o samples\client\petstore\kotlin-nonpublic
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/kotlin-client-nullable.bat b/bin/windows/kotlin-client-nullable.bat
new file mode 100644
index 00000000000..cdbfa49839c
--- /dev/null
+++ b/bin/windows/kotlin-client-nullable.bat
@@ -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 kotlin --artifact-id "kotlin-petstore-nullable" --additional-properties nullableReturnType=true,serializableModel=true -o samples\client\petstore\kotlin-nullable
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/kotlin-client-okhttp3.bat b/bin/windows/kotlin-client-okhttp3.bat
new file mode 100644
index 00000000000..8c16e37fe05
--- /dev/null
+++ b/bin/windows/kotlin-client-okhttp3.bat
@@ -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 --artifact-id "kotlin-petstore-okhttp3" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --library jvm-okhttp3 -o samples\client\petstore\kotlin-okhttp3
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/kotlin-client-petstore.bat b/bin/windows/kotlin-client-petstore.bat
index e6f2cd35d04..a193d7c6a3e 100644
--- a/bin/windows/kotlin-client-petstore.bat
+++ b/bin/windows/kotlin-client-petstore.bat
@@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
-set ags=generate --artifact-id "kotlin-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin -o samples\client\petstore\kotlin
+set ags=generate --artifact-id "kotlin-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin -o samples\client\petstore\kotlin --additional-properties dateLibrary=java8,serializableModel=true
java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/kotlin-client-string.bat b/bin/windows/kotlin-client-string.bat
new file mode 100644
index 00000000000..f393eedf8f6
--- /dev/null
+++ b/bin/windows/kotlin-client-string.bat
@@ -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 kotlin --artifact-id "kotlin-petstore-string" --additional-properties dateLibrary=string,serializableModel=true -o samples\client\petstore\kotlin-string
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/kotlin-client-threetenbp.bat b/bin/windows/kotlin-client-threetenbp.bat
new file mode 100644
index 00000000000..adc5c68e01a
--- /dev/null
+++ b/bin/windows/kotlin-client-threetenbp.bat
@@ -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 kotlin --artifact-id "kotlin-petstore-threetenbp" --additional-properties dateLibrary=threetenbp -o samples\client\petstore\kotlin-threetenbp
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/typescript-angular-petstore-all.bat b/bin/windows/typescript-angular-petstore-all.bat
index bc57daca4bb..46dc9814917 100644
--- a/bin/windows/typescript-angular-petstore-all.bat
+++ b/bin/windows/typescript-angular-petstore-all.bat
@@ -13,3 +13,4 @@ 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-v8-provided-in-root-with-npm.bat
call .\bin\windows\typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.bat
+call .\bin\windows\typescript-angular-v8-single-request-parameter.bat
diff --git a/bin/windows/typescript-angular-v8-single-request-parameter.bat b/bin/windows/typescript-angular-v8-single-request-parameter.bat
new file mode 100644
index 00000000000..c963702b04c
--- /dev/null
+++ b/bin/windows/typescript-angular-v8-single-request-parameter.bat
@@ -0,0 +1,10 @@
+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\single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true
+
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md
index ae605279faa..346932bc6e3 100644
--- a/docs/generators/csharp-netcore.md
+++ b/docs/generators/csharp-netcore.md
@@ -18,6 +18,9 @@ sidebar_label: csharp-netcore
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true|
+|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true|
+|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false|
+|optionalProjectFile|Generate {PackageName}.csproj.| |true|
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md
index a2094d82603..a602a39c42b 100644
--- a/docs/generators/go-server.md
+++ b/docs/generators/go-server.md
@@ -10,3 +10,4 @@ sidebar_label: go-server
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|sourceFolder|source folder for generated code| |go|
|serverPort|The network port the generated server binds to| |8080|
+|featureCORS|Enable Cross-Origin Resource Sharing middleware| |false|
diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md
index 843d1780128..a93641a10ce 100644
--- a/docs/generators/kotlin-spring.md
+++ b/docs/generators/kotlin-spring.md
@@ -28,4 +28,5 @@ sidebar_label: kotlin-spring
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
|reactive|use coroutines for reactive behavior| |false|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
+|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|library|library template (sub-template)|
- **spring-boot**
- Spring-boot Server application.
|spring-boot|
diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md
index 1ab11ff90e0..9c49c147614 100644
--- a/docs/generators/typescript-angular.md
+++ b/docs/generators/typescript-angular.md
@@ -16,6 +16,7 @@ sidebar_label: typescript-angular
|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|
|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.| |false|
|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false|
|providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0).| |false|
|ngVersion|The version of Angular.| |8.0.0|
diff --git a/docs/integration.md b/docs/integration.md
index 0ab59c547b4..fdf2898646d 100644
--- a/docs/integration.md
+++ b/docs/integration.md
@@ -19,6 +19,14 @@ Supported tasks include:
See the [openapi-generator-maven-plugin README](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md) for details related to configuring and using the Maven Plugin.
+### sbt Integration
+
+Please refer to https://github.com/upstart-commerce/sbt-openapi-generator
+
+### Bazel Integration
+
+Please refer to https://github.com/OpenAPITools/openapi-generator-bazel
+
### GitHub Integration
To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example:
diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java
index 4ec67be8914..e16b281d6d3 100644
--- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java
+++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java
@@ -72,15 +72,34 @@ public class Meta implements Runnable {
allowedValues = {"CLIENT", "SERVER", "DOCUMENTATION", "CONFIG", "OTHER"})
private String type = "OTHER";
+ @Option(name = {"-l", "--language"}, title = "language",
+ description = "the implementation language for the generator class",
+ allowedValues = {"java", "kotlin"}
+ )
+ private String language = "java";
+
@Override
public void run() {
final File targetDir = new File(outputFolder);
LOGGER.info("writing to folder [{}]", targetDir.getAbsolutePath());
String mainClass = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, name) + "Generator";
+ String kebabName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, name);
- List supportingFiles =
+ List supportingFiles = "kotlin".equals(language) ?
ImmutableList.of(
+ new SupportingFile("kotlin/build_gradle.mustache", "", "build.gradle.kts"),
+ new SupportingFile("kotlin/gradle.properties", "", "gradle.properties"),
+ new SupportingFile("kotlin/settings.mustache", "", "settings.gradle"),
+ new SupportingFile("kotlin/generatorClass.mustache", on(File.separator).join("src/main/kotlin", asPath(targetPackage)), mainClass.concat(".kt")),
+ new SupportingFile("kotlin/generatorClassTest.mustache", on(File.separator).join("src/test/kotlin", asPath(targetPackage)), mainClass.concat("Test.kt")),
+ new SupportingFile("kotlin/README.mustache", "", "README.md"),
+
+ new SupportingFile("api.template", "src/main/resources" + File.separator + name,"api.mustache"),
+ new SupportingFile("model.template", "src/main/resources" + File.separator + name,"model.mustache"),
+ new SupportingFile("myFile.template", String.join(File.separator, "src", "main", "resources", name), "myFile.mustache"),
+ new SupportingFile("services.mustache", "src/main/resources/META-INF/services", CodegenConfig.class.getCanonicalName()))
+ : ImmutableList.of(
new SupportingFile("pom.mustache", "", "pom.xml"),
new SupportingFile("generatorClass.mustache", on(File.separator).join("src/main/java", asPath(targetPackage)), mainClass.concat(".java")),
new SupportingFile("generatorClassTest.mustache", on(File.separator).join("src/test/java", asPath(targetPackage)), mainClass.concat("Test.java")),
@@ -97,6 +116,7 @@ public class Meta implements Runnable {
.put("generatorPackage", targetPackage)
.put("generatorClass", mainClass)
.put("name", name)
+ .put("kebabName", kebabName)
.put("generatorType", type)
.put("fullyQualifiedGeneratorClass", targetPackage + "." + mainClass)
.put("openapiGeneratorVersion", currentVersion).build();
diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java
index bf13cacf7b2..174109f37b9 100644
--- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java
+++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java
@@ -103,7 +103,9 @@ public class WorkflowSettings {
builder.strictSpecBehavior = copy.isStrictSpecBehavior();
builder.templatingEngineName = copy.getTemplatingEngineName();
builder.ignoreFileOverride = copy.getIgnoreFileOverride();
- builder.systemProperties = ImmutableMap.copyOf(copy.getSystemProperties());
+
+ // this, and any other collections, must be mutable in the builder.
+ builder.systemProperties = new HashMap<>(copy.getSystemProperties());
// force builder "with" methods to invoke side effects
builder.withTemplateDir(copy.getTemplateDir());
@@ -272,6 +274,8 @@ public class WorkflowSettings {
private String templateDir;
private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME;
private String ignoreFileOverride;
+
+ // NOTE: All collections must be mutable in the builder, and copied to a new immutable collection in .build()
private Map systemProperties = new HashMap<>();;
private Builder() {
diff --git a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java
index b958c9decf4..c375e98df2c 100644
--- a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java
+++ b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java
@@ -19,6 +19,7 @@ package org.openapitools.codegen.config;
import org.testng.annotations.Test;
import java.nio.file.Paths;
+import java.util.Map;
import static org.testng.Assert.*;
@@ -48,6 +49,25 @@ public class WorkflowSettingsTest {
assertTrue(settings.isStrictSpecBehavior());
}
+ @Test
+ public void newBuilderFromCopyShouldMutateSystemProperties(){
+ WorkflowSettings original = WorkflowSettings.newBuilder()
+ .withOutputDir("output")
+ .withVerbose(true)
+ .withSkipOverwrite(false)
+ .withSystemProperty("first", "1st")
+ .build();
+
+ WorkflowSettings modified = WorkflowSettings.newBuilder(original)
+ .withSystemProperty("second", "2nd")
+ .build();
+
+ Map properties = modified.getSystemProperties();
+ assertEquals(properties.size(), 2, "System Properties map should allow mutation when invoked via copy constructor");
+ assertEquals(properties.getOrDefault("first", ""), "1st");
+ assertEquals(properties.getOrDefault("second", ""), "2nd");
+ }
+
private void assertOnChangesToDefaults(WorkflowSettings defaults) {
WorkflowSettings settings = WorkflowSettings.newBuilder()
.withOutputDir("output")
diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc
index d836faf38b3..1ba8c136a66 100644
--- a/modules/openapi-generator-gradle-plugin/README.adoc
+++ b/modules/openapi-generator-gradle-plugin/README.adoc
@@ -45,7 +45,7 @@ compileJava.dependsOn tasks.openApiGenerate
[source,group]
----
plugins {
- id "org.openapi.generator" version "4.2.0"
+ id "org.openapi.generator" version "4.2.2-SNAPSHOT"
}
----
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
index 702381eed21..9a2f6139045 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
@@ -11,11 +11,12 @@ gradle openApiGenerate
gradle openApiMeta
gradle openApiValidate
gradle buildGoSdk
+gradle buildDotnetSdk
gradle generateGoWithInvalidSpec
```
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
```bash
-gradle -PopenApiGeneratorVersion=4.2.0 openApiValidate
+gradle -PopenApiGeneratorVersion=4.2.2-SNAPSHOT openApiValidate
```
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle
index 68913ab6c2c..99e3d0f674c 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle
@@ -65,6 +65,20 @@ task buildGoSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTas
]
}
+task buildDotnetSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
+ generatorName = "csharp-netcore"
+ inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
+ additionalProperties = [
+ packageGuid: "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}",
+ useCompareNetObjects: "true"
+ ]
+ outputDir = "$buildDir/csharp-netcore".toString()
+ systemProperties = [
+ models: "",
+ apis : "",
+ ]
+}
+
task generateGoWithInvalidSpec(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
validateSpec = true
generatorName = "go"
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
index 464b884ea30..240b76bafa8 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
@@ -1,3 +1,3 @@
# RELEASE_VERSION
-openApiGeneratorVersion=4.1.1
+openApiGeneratorVersion=4.2.0
# /RELEASE_VERSION
diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md
index b1bb352e773..3e10c5bc67b 100644
--- a/modules/openapi-generator-maven-plugin/README.md
+++ b/modules/openapi-generator-maven-plugin/README.md
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
org.openapitools
openapi-generator-maven-plugin
- 4.2.0
+ 4.2.2-SNAPSHOT
diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml
index b19be19ac1f..7c00f5680f9 100644
--- a/modules/openapi-generator-maven-plugin/examples/java-client.xml
+++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml
@@ -13,7 +13,7 @@
org.openapitools
openapi-generator-maven-plugin
- 4.1.3-SNAPSHOT
+ 4.2.2-SNAPSHOT
diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml
new file mode 100644
index 00000000000..83b54be3dab
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml
@@ -0,0 +1,237 @@
+
+ 4.0.0
+ org.openapitools
+ sample-project
+ jar
+ 1.0-SNAPSHOT
+ sample-project
+ http://maven.apache.org
+
+
+
+
+
+ org.openapitools
+ openapi-generator-maven-plugin
+
+ 4.2.1-SNAPSHOT
+
+
+
+ default
+
+ generate
+
+
+
+ ${project.basedir}/swagger.yaml
+
+
+ kotlin
+
+
+
+
+
+ true
+
+
+
+
+
+ kotlin
+ generate-sources
+
+ generate
+
+
+
+ https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+
+
+
+ kotlin
+
+
+
+
+
+ true
+
+
+
+ kotlintest.org.openapitools.client.api
+ kotlintest.org.openapitools.client.model
+ kotlintest.org.openapitools.client
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+ 1.8
+ 1.8
+ none
+
+
+
+ kotlin-maven-plugin
+ org.jetbrains.kotlin
+
+ ${kotlinJvmTarget}
+
+
+
+
+ compile
+
+ compile
+
+
+
+ ${project.build.directory}/generated-sources/kotlin/src/main/kotlin
+
+
+
+
+
+
+
+
+
+ kotlin-maven-plugin
+ org.jetbrains.kotlin
+ ${kotlin.version}
+
+
+
+
+
+
+ sonatype-snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey-version}
+
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-base
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ ${jackson-version}
+
+
+ org.openapitools
+ jackson-databind-nullable
+ ${jackson-databind-nullable-version}
+
+
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson-version}
+
+
+ joda-time
+ joda-time
+ ${jodatime-version}
+
+
+
+
+ com.brsanthu
+ migbase64
+ ${migbase64.version}
+
+
+ com.squareup.moshi
+ moshi-kotlin
+ ${moshi-kotlin.version}
+
+
+ com.squareup.moshi
+ moshi-adapters
+ ${moshi-kotlin.version}
+
+
+ com.squareup.okhttp3
+ okhttp
+ 4.2.2
+
+
+
+
+ 1.5.8
+ 2.27
+ 2.8.9
+ 0.2.0
+ 2.7
+ 1.0.0
+ 4.8.1
+ 1.3.50
+ 1.8
+ 1.8.0
+ 2.2
+
+
diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml
index 9155e3e0048..1ffead35a08 100644
--- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml
+++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml
@@ -13,7 +13,7 @@
org.openapitools
openapi-generator-maven-plugin
- 4.1.1
+ 4.2.2-SNAPSHOT
diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml
index 6c559f97c45..ba2ee84c6f5 100644
--- a/modules/openapi-generator-maven-plugin/examples/non-java.xml
+++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml
@@ -13,7 +13,7 @@
org.openapitools
openapi-generator-maven-plugin
- 4.1.1
+ 4.2.2-SNAPSHOT
diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml
new file mode 100644
index 00000000000..cd9b115797c
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/examples/spring.xml
@@ -0,0 +1,126 @@
+
+ 4.0.0
+ org.openapitools
+ sample-project
+ jar
+ 1.0-SNAPSHOT
+ sample-project
+ http://maven.apache.org
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.2.1.RELEASE
+
+
+
+
+
+ org.openapitools
+ openapi-generator-maven-plugin
+
+ 4.2.2-SNAPSHOT
+
+
+
+ spring-server
+
+ generate
+
+
+
+ ${project.basedir}/swagger.yaml
+
+
+ spring
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+ 1.8
+ 1.8
+ none
+
+
+
+
+
+
+
+
+ sonatype-snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ io.springfox
+ springfox-swagger2
+ ${springfox-version}
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${springfox-version}
+
+
+ javax.xml.bind
+ jaxb-api
+ 2.2.11
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+ org.openapitools
+ jackson-databind-nullable
+ 0.1.0
+
+
+
+ javax.validation
+ validation-api
+
+
+
+
+ 1.5.8
+
+ 2.2.1.RELEASE
+ 2.8.0
+
+
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java
index ea354971202..ea51d6ff559 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java
@@ -17,6 +17,7 @@
package org.openapitools.codegen;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@@ -38,7 +39,7 @@ public class CodegenSecurity {
// Oauth specific
public String flow, authorizationUrl, tokenUrl;
public List