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`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.2-SNAPSHOT`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) [![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/master)](https://cloud.drone.io/OpenAPITools/openapi-generator) +[`4.3.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.3.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/4.3.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) +[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/4.3.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) +[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=4.3.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator) +[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=4.3.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) +[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/4.3.x)](https://cloud.drone.io/OpenAPITools/openapi-generator) + [`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.0.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=5.0.x)](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 + + + ${project.build.directory}/generated-sources/kotlin + 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> scopes; - public Boolean isCode, isPassword, isApplication, isImplicit, hasScopes; + public Boolean isCode, isPassword, isApplication, isImplicit; @Override public String toString() { @@ -100,4 +101,47 @@ public class CodegenSecurity { isImplicit, scopes); } + + // Return a copy of the security object, filtering out any scopes from the passed-in list. + public CodegenSecurity filterByScopeNames(List filterScopes) { + CodegenSecurity filteredSecurity = new CodegenSecurity(); + // Copy all fields except the scopes. + filteredSecurity.name = name; + filteredSecurity.type = type; + filteredSecurity.hasMore = false; + filteredSecurity.isBasic = isBasic; + filteredSecurity.isBasicBasic = isBasicBasic; + filteredSecurity.isBasicBearer = isBasicBearer; + filteredSecurity.isApiKey = isApiKey; + filteredSecurity.isOAuth = isOAuth; + filteredSecurity.keyParamName = keyParamName; + filteredSecurity.isCode = isCode; + filteredSecurity.isImplicit = isImplicit; + filteredSecurity.isApplication = isApplication; + filteredSecurity.isPassword = isPassword; + filteredSecurity.isKeyInCookie = isKeyInCookie; + filteredSecurity.isKeyInHeader = isKeyInHeader; + filteredSecurity.isKeyInQuery = isKeyInQuery; + filteredSecurity.flow = flow; + filteredSecurity.tokenUrl = tokenUrl; + filteredSecurity.authorizationUrl = authorizationUrl; + // It is not possible to deep copy the extensions, as we have no idea what types they are. + // So the filtered method *will* refer to the original extensions, if any. + filteredSecurity.vendorExtensions = new HashMap(vendorExtensions); + List> returnedScopes = new ArrayList>(); + Map lastScope = null; + for (String filterScopeName : filterScopes) { + for (Map scope : scopes) { + String name = (String) scope.get("scope"); + if (filterScopeName.equals(name)) { + returnedScopes.add(scope); + lastScope = scope; + break; + } + } + } + filteredSecurity.scopes = returnedScopes; + + return filteredSecurity; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index f29243ef151..c2347eabfdb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1086,6 +1086,7 @@ public class DefaultCodegen implements CodegenConfig { reservedWords = new HashSet(); + // TODO: Move Java specific import mappings out of DefaultCodegen. importMapping = new HashMap(); importMapping.put("BigDecimal", "java.math.BigDecimal"); importMapping.put("UUID", "java.util.UUID"); @@ -1895,6 +1896,7 @@ public class DefaultCodegen implements CodegenConfig { if (composed.getRequired() != null) { required.addAll(composed.getRequired()); + allRequired.addAll(composed.getRequired()); } addVars(m, unaliasPropertySchema(properties), required, unaliasPropertySchema(allProperties), allRequired); @@ -4401,14 +4403,9 @@ public class DefaultCodegen implements CodegenConfig { * @return property value as boolean */ public boolean convertPropertyToBooleanAndWriteBack(String propertyKey) { - boolean booleanValue = false; - if (additionalProperties.containsKey(propertyKey)) { - booleanValue = convertPropertyToBoolean(propertyKey); - // write back as boolean - writePropertyBack(propertyKey, booleanValue); - } - - return booleanValue; + boolean result = convertPropertyToBoolean(propertyKey); + writePropertyBack(propertyKey, result); + return result; } /** @@ -4432,12 +4429,16 @@ public class DefaultCodegen implements CodegenConfig { } public boolean convertPropertyToBoolean(String propertyKey) { - boolean booleanValue = false; - if (additionalProperties.containsKey(propertyKey)) { - booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString()); + final Object booleanValue = additionalProperties.get(propertyKey); + Boolean result = Boolean.FALSE; + if (booleanValue instanceof Boolean) { + result = (Boolean) booleanValue; + } else if (booleanValue instanceof String) { + result = Boolean.parseBoolean((String) booleanValue); + } else { + LOGGER.warn("The value (generator's option) must be either boolean or string. Default to `false`."); } - - return booleanValue; + return result; } public void writePropertyBack(String propertyKey, boolean value) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 98a0226afa2..7f56122e52c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -1057,55 +1057,21 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { } Map authMethods = getAuthMethods(securities, securitySchemes); - if (authMethods == null || authMethods.isEmpty()) { - authMethods = getAuthMethods(globalSecurities, securitySchemes); - } if (authMethods != null && !authMethods.isEmpty()) { - codegenOperation.authMethods = config.fromSecurity(authMethods); - List> scopes = new ArrayList>(); - if (codegenOperation.authMethods != null) { - for (CodegenSecurity security : codegenOperation.authMethods) { - if (security != null && security.isBasicBearer != null && security.isBasicBearer && - securities != null) { - for (SecurityRequirement req : securities) { - if (req == null) continue; - for (String key : req.keySet()) { - if (security.name != null && key.equals(security.name)) { - int count = 0; - for (String sc : req.get(key)) { - Map scope = new HashMap(); - scope.put("scope", sc); - scope.put("description", ""); - count++; - if (req.get(key) != null && count < req.get(key).size()) { - scope.put("hasMore", "true"); - } else { - scope.put("hasMore", null); - } - scopes.add(scope); - } - //end this inner for - break; - } - } + List fullAuthMethods = config.fromSecurity(authMethods); + codegenOperation.authMethods = filterAuthMethods(fullAuthMethods, securities); + codegenOperation.hasAuthMethods = true; + } else { + authMethods = getAuthMethods(globalSecurities, securitySchemes); - } - security.hasScopes = scopes.size() > 0; - security.scopes = scopes; - } - } + if (authMethods != null && !authMethods.isEmpty()) { + List fullAuthMethods = config.fromSecurity(authMethods); + codegenOperation.authMethods = filterAuthMethods(fullAuthMethods, globalSecurities); + codegenOperation.hasAuthMethods = true; } - codegenOperation.hasAuthMethods = true; } - /* TODO need to revise the logic below - Map securitySchemeMap = openAPI.getComponents().getSecuritySchemes(); - if (securitySchemeMap != null && !securitySchemeMap.isEmpty()) { - codegenOperation.authMethods = config.fromSecurity(securitySchemeMap); - codegenOperation.hasAuthMethods = true; - } - */ } catch (Exception ex) { String msg = "Could not process operation:\n" // + " Tag: " + tag + "\n"// @@ -1311,6 +1277,40 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { .scopes(newScopes); } + private List filterAuthMethods(List authMethods, List securities) { + if (securities == null || securities.isEmpty() || authMethods == null) { + return authMethods; + } + + List result = new ArrayList(); + + for (CodegenSecurity security : authMethods) { + boolean filtered = false; + if (security != null && security.scopes != null) { + for (SecurityRequirement requirement : securities) { + List opScopes = requirement.get(security.name); + if (opScopes != null) { + // We have operation-level scopes for this method, so filter the auth method to + // describe the operation auth method with only the scopes that it requires. + // We have to create a new auth method instance because the original object must + // not be modified. + CodegenSecurity opSecurity = security.filterByScopeNames(opScopes); + result.add(opSecurity); + filtered = true; + break; + } + } + } + + // If we didn't get a filtered version, then we can keep the original auth method. + if (!filtered) { + result.add(security); + } + } + + return result; + } + private boolean hasOAuthMethods(List authMethods) { for (CodegenSecurity cs : authMethods) { if (Boolean.TRUE.equals(cs.isOAuth)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java index 5eb052d1a54..df98e9aa552 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java @@ -300,12 +300,17 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg URL url = URLPathUtils.getServerURL(openAPI, serverVariableOverrides()); String port = URLPathUtils.getPort(url, ""); String host = url.getHost(); + String scheme = url.getProtocol(); + if(!port.isEmpty()) { this.additionalProperties.put("serverPort", port); } if(!host.isEmpty()) { this.additionalProperties.put("serverHost", host); } + if(!scheme.isEmpty()) { + this.additionalProperties.put("scheme", scheme); + } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index eb4ed1e9164..823278ca949 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -1040,23 +1040,22 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } } + // TODO: Setting additionalProperties is not the responsibility of this method. These side-effects should be moved elsewhere to prevent unexpected behaviors. if(artifactVersion == null) { // If no artifactVersion is provided in additional properties, version from API specification is used. // If none of them is provided then fallbacks to default version - if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) { + if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION) && additionalProperties.get(CodegenConstants.ARTIFACT_VERSION) != null) { this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION)); } else if (openAPI.getInfo() != null && openAPI.getInfo().getVersion() != null) { this.setArtifactVersion(openAPI.getInfo().getVersion()); } else { this.setArtifactVersion(ARTIFACT_VERSION_DEFAULT_VALUE); } - } else { - additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); } + additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); if (additionalProperties.containsKey(CodegenConstants.SNAPSHOT_VERSION)) { - Boolean useSnapshotVersion = Boolean.valueOf((String) additionalProperties.get(CodegenConstants.SNAPSHOT_VERSION)); - if (useSnapshotVersion) { + if (convertPropertyToBooleanAndWriteBack(CodegenConstants.SNAPSHOT_VERSION)) { this.setArtifactVersion(this.buildSnapshotVersion(this.getArtifactVersion())); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 57c45a76fb0..733cdd47b47 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -434,19 +434,19 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { - this.setSerializableModel(Boolean.valueOf((String) additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL))); + this.setSerializableModel(convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL)); } else { additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); } if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) { - this.setParcelizeModels(Boolean.valueOf((String) additionalProperties.get(CodegenConstants.PARCELIZE_MODELS))); + this.setParcelizeModels(convertPropertyToBooleanAndWriteBack(CodegenConstants.PARCELIZE_MODELS)); } else { additionalProperties.put(CodegenConstants.PARCELIZE_MODELS, parcelizeModels); } if (additionalProperties.containsKey(CodegenConstants.NON_PUBLIC_API)) { - this.setNonPublicApi(Boolean.valueOf((String) additionalProperties.get(CodegenConstants.NON_PUBLIC_API))); + this.setNonPublicApi(convertPropertyToBooleanAndWriteBack(CodegenConstants.NON_PUBLIC_API)); } else { additionalProperties.put(CodegenConstants.NON_PUBLIC_API, nonPublicApi); } @@ -501,7 +501,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co public void setSerializableModel(boolean serializableModel) { this.serializableModel = serializableModel; } - + public boolean nonPublicApi() { return nonPublicApi; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java index 5e8e788209a..23fa88fb05e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java @@ -81,10 +81,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code if (Files.isRegularFile(filePathToInclude)) { LOGGER.debug( "including " + ++includeCount + ". file into markup from: " + filePathToInclude.toString()); - out.write("\ninclude::" + relativeFileName + "[]\n"); + out.write("\ninclude::" + relativeFileName + "[opts=optional]\n"); } else { LOGGER.debug(++notFoundCount + ". file not found, skip include for: " + filePathToInclude.toString()); - out.write("\n// markup not found, no include ::" + relativeFileName + "[]\n"); + out.write("\n// markup not found, no include ::" + relativeFileName + "[opts=optional]\n"); } } } @@ -158,6 +158,8 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code */ static String sanitize(final String name) { String sanitized = name == null ? "" : name.trim(); + sanitized = sanitized.replace("//", "/"); // rest paths may or may not end with slashes, leading to redundant + // path separators. return sanitized.startsWith(File.separator) || sanitized.startsWith("/") ? sanitized.substring(1) : sanitized; } @@ -200,10 +202,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code cliOptions.add(new CliOption(SNIPPET_DIR, "path with includable markup snippets (e.g. test output generated by restdoc, default: .") - .defaultValue(".")); + .defaultValue(".")); cliOptions.add(new CliOption(SPEC_DIR, "path with includable markup spec files (e.g. handwritten additional docs, default: .") - .defaultValue("..")); + .defaultValue("..")); additionalProperties.put("appName", "OpenAPI Sample description"); additionalProperties.put("appDescription", "A sample OpenAPI documentation"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index e4ee543b41d..9347dc4d10c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -181,6 +181,18 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { "C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).", this.optionalMethodArgumentFlag); + addSwitch(CodegenConstants.OPTIONAL_ASSEMBLY_INFO, + CodegenConstants.OPTIONAL_ASSEMBLY_INFO_DESC, + this.optionalAssemblyInfoFlag); + + addSwitch(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES, + CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES_DESC, + this.optionalEmitDefaultValuesFlag); + + addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, + CodegenConstants.OPTIONAL_PROJECT_FILE_DESC, + this.optionalProjectFileFlag); + // NOTE: This will reduce visibility of all public members in templates. Users can use InternalsVisibleTo // https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute(v=vs.110).aspx // to expose to shared code if the generated code is not embedded into another project. Otherwise, users of codegen @@ -362,6 +374,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { postProcessPattern(property.pattern, property.vendorExtensions); + postProcessEmitDefaultValue(property.vendorExtensions); + super.postProcessModelProperty(model, property); } @@ -395,6 +409,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { @Override public void postProcessParameter(CodegenParameter parameter) { postProcessPattern(parameter.pattern, parameter.vendorExtensions); + postProcessEmitDefaultValue(parameter.vendorExtensions); super.postProcessParameter(parameter); if (!parameter.required && nullableType.contains(parameter.dataType)) { //optional @@ -438,6 +453,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { } } + public void postProcessEmitDefaultValue(Map vendorExtensions) { + vendorExtensions.put("x-emit-default-value", optionalEmitDefaultValuesFlag); + } + @Override public Mustache.Compiler processCompiler(Mustache.Compiler compiler) { // To avoid unexpected behaviors when options are passed programmatically such as { "supportsAsync": "" } @@ -457,6 +476,13 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { * if (additionalProperties.containsKey(prop)) convertPropertyToBooleanAndWriteBack(prop); */ + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES)) { + setOptionalEmitDefaultValuesFlag(convertPropertyToBooleanAndWriteBack(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES)); + } else { + additionalProperties.put(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES, optionalEmitDefaultValuesFlag); + } + + if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); } @@ -572,6 +598,18 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { this.netStandard = netStandard; } + public void setOptionalAssemblyInfoFlag(boolean flag) { + this.optionalAssemblyInfoFlag = flag; + } + + public void setOptionalEmitDefaultValuesFlag(boolean flag){ + this.optionalEmitDefaultValuesFlag = flag; + } + + public void setOptionalProjectFileFlag(boolean flag) { + this.optionalProjectFileFlag = flag; + } + public void setPackageGuid(String packageGuid) { this.packageGuid = packageGuid; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index e06440e5443..314caff8ea2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -26,12 +26,47 @@ import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; import java.util.*; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; +// import static org.openapitools.codegen.utils.StringUtils.camelize; +// import static org.openapitools.codegen.utils.StringUtils.underscore; + +// import java.io.BufferedReader; +// import java.io.File; +// import java.io.FileInputStream; +// import java.io.InputStreamReader; +// import java.nio.charset.Charset; +// import java.util.ArrayList; +// import java.util.Arrays; +// import java.util.HashMap; +// import java.util.HashSet; +// import java.util.List; +// import java.util.Map; +// import java.util.Set; + +// import javax.xml.validation.Schema; + +// import org.apache.commons.io.FilenameUtils; +// import org.openapitools.codegen.CodegenConfig; +// import org.openapitools.codegen.CodegenConstants; +// import org.openapitools.codegen.CodegenModel; +// import org.openapitools.codegen.CodegenProperty; +// import org.openapitools.codegen.CodegenType; +// import org.openapitools.codegen.DefaultCodegen; +// import org.openapitools.codegen.utils.ModelUtils; +// import org.openapitools.codegen.utils.StringUtils; +// import org.slf4j.LoggerFactory; + +// import io.swagger.v3.oas.models.media.ArraySchema; + public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { private static final Logger LOGGER = LoggerFactory.getLogger(DartClientCodegen.class); @@ -55,8 +90,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { public DartClientCodegen() { super(); - // clear import mapping (from default generator) as dart does not use it - // at the moment + // clear import mapping (from default generator) as dart does not use it at the moment importMapping.clear(); outputFolder = "generated-code/dart"; @@ -71,19 +105,15 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { modelTestTemplateFiles.put("model_test.mustache", ".dart"); apiTestTemplateFiles.put("api_test.mustache", ".dart"); - setReservedWordsLowerCase( - Arrays.asList( - "abstract", "as", "assert", "async", "async*", "await", - "break", "case", "catch", "class", "const", "continue", - "default", "deferred", "do", "dynamic", "else", "enum", - "export", "external", "extends", "factory", "false", "final", - "finally", "for", "get", "if", "implements", "import", "in", - "is", "library", "new", "null", "operator", "part", "rethrow", - "return", "set", "static", "super", "switch", "sync*", "this", - "throw", "true", "try", "typedef", "var", "void", "while", - "with", "yield", "yield*", "hide", "interface", "mixin", "on", - "show", "async") - ); + List reservedWordsList = new ArrayList(); + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(DartClientCodegen.class.getResourceAsStream("/dart/dart-keywords.txt"), Charset.forName("UTF-8"))); + while(reader.ready()) { reservedWordsList.add(reader.readLine()); } + reader.close(); + } catch (Exception e) { + LOGGER.error("Error reading dart keywords. Exception: {}", e.getMessage()); + } + setReservedWordsLowerCase(reservedWordsList); languageSpecificPrimitives = new HashSet( Arrays.asList( diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index f61e1b7b55c..0729817c489 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -80,6 +80,7 @@ public class DartDioClientCodegen extends DartClientCodegen { importMapping.put("BuiltList", "package:built_collection/built_collection.dart"); importMapping.put("BuiltMap", "package:built_collection/built_collection.dart"); + importMapping.put("JsonObject", "package:built_value/json_object.dart"); importMapping.put("Uint8List", "dart:typed_data"); } @@ -129,6 +130,13 @@ public class DartDioClientCodegen extends DartClientCodegen { return name; } + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { + //super.addAdditionPropertiesToCodeGenModel(codegenModel, schema); + codegenModel.additionalPropertiesType = getSchemaType(ModelUtils.getAdditionalProperties(schema)); + addImport(codegenModel, codegenModel.additionalPropertiesType); + } + @Override public void processOpts() { if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) { @@ -230,9 +238,16 @@ public class DartDioClientCodegen extends DartClientCodegen { //Updates any List properties on a model to a BuiltList. This happens in post processing rather //than type mapping as we only want this to apply to models, not every other class. if ("List".equals(property.baseType)) { - property.setDatatype(property.dataType.replaceAll(property.baseType, "BuiltList")); + property.setDatatype( + property.dataType.replaceAll(property.baseType, "BuiltList")); property.setBaseType("BuiltList"); model.imports.add("BuiltList"); + if ("Object".equals(property.items.baseType)) { + property.setDatatype( + property.dataType.replaceAll("Object", "JsonObject")); + property.items.setDatatype("JsonObject"); + model.imports.add("JsonObject"); + } } } if (property.isMapContainer) { @@ -242,6 +257,11 @@ public class DartDioClientCodegen extends DartClientCodegen { property.setDatatype(property.dataType.replaceAll(property.baseType, "BuiltMap")); property.setBaseType("BuiltMap"); model.imports.add("BuiltMap"); + if ("Object".equals(property.items.baseType)) { + property.setDatatype(property.dataType.replaceAll("Object", "JsonObject")); + property.items.setDatatype("JsonObject"); + model.imports.add("JsonObject"); + } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java index 3f08e337fa4..d192dd80010 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java @@ -373,7 +373,13 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { elmImports.add(elmImport); } } - if (cm.discriminator != null) { + if (cm.oneOf != null) { + for (String variant : cm.oneOf) { + final ElmImport elmImport = createImport(variant); + elmImports.add(elmImport); + } + } + if (cm.discriminator != null && cm.children != null) { for (CodegenModel child : cm.children) { // add child imports final ElmImport elmImport = createImport(child.classname); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java index a4951e19c5d..db2f36d1f32 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java @@ -39,6 +39,7 @@ public class GoServerCodegen extends AbstractGoCodegen { protected int serverPort = 8080; protected String projectName = "openapi-server"; protected String sourceFolder = "go"; + protected Boolean corsFeatureEnabled = false; public GoServerCodegen() { @@ -46,15 +47,20 @@ public class GoServerCodegen extends AbstractGoCodegen { // set the output folder here outputFolder = "generated-code/go"; - + cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC) .defaultValue(sourceFolder)); - + CliOption optServerPort = new CliOption("serverPort", "The network port the generated server binds to"); optServerPort.setType("int"); optServerPort.defaultValue(Integer.toString(serverPort)); cliOptions.add(optServerPort); + CliOption optFeatureCORS = new CliOption("featureCORS", "Enable Cross-Origin Resource Sharing middleware"); + optFeatureCORS.setType("bool"); + optFeatureCORS.defaultValue(corsFeatureEnabled.toString()); + cliOptions.add(optFeatureCORS); + /* * Models. You can write model files using the modelTemplateFiles map. * if you want to create one template for file, you can do so here. @@ -111,8 +117,8 @@ public class GoServerCodegen extends AbstractGoCodegen { @Override public void processOpts() { super.processOpts(); - - + + /* * Additional Properties. These values can be passed to the templates and * are available in models, apis, and supporting files @@ -123,25 +129,31 @@ public class GoServerCodegen extends AbstractGoCodegen { setPackageName("openapi"); additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); } - + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { this.setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); } else { additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); } - + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); } else { additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder); } - + if (additionalProperties.containsKey("serverPort") && additionalProperties.get("serverPort") instanceof Integer) { this.setServerPort((int) additionalProperties.get("serverPort")); } else { additionalProperties.put("serverPort", serverPort); } + if (additionalProperties.containsKey("featureCORS")) { + this.setFeatureCORS(convertPropertyToBooleanAndWriteBack("featureCORS")); + } else { + additionalProperties.put("featureCORS", corsFeatureEnabled); + } + modelPackage = packageName; apiPackage = packageName; @@ -251,7 +263,7 @@ public class GoServerCodegen extends AbstractGoCodegen { public String modelFileFolder() { return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); } - + public void setSourceFolder(String sourceFolder) { this.sourceFolder = sourceFolder; } @@ -262,5 +274,9 @@ public class GoServerCodegen extends AbstractGoCodegen { public void setServerPort(int serverPort) { this.serverPort = serverPort; - } + } + + public void setFeatureCORS(Boolean featureCORS) { + this.corsFeatureEnabled = featureCORS; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index b7e5836a8b2..2f463f51a57 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -30,6 +30,8 @@ import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; public class KotlinClientCodegen extends AbstractKotlinCodegen { @@ -166,7 +168,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { if (isJVMLibrary()) { additionalProperties.put(JVM, true); - + if (JVM_OKHTTP4.equals(getLibrary())) { additionalProperties.put(JVM_OKHTTP4, true); } else if (JVM_OKHTTP3.equals(getLibrary())) { @@ -186,6 +188,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { supportingFiles.add(new SupportingFile("infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); supportingFiles.add(new SupportingFile("infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); supportingFiles.add(new SupportingFile("infrastructure/UUIDAdapter.kt.mustache", infrastructureFolder, "UUIDAdapter.kt")); + if (getSerializationLibrary() == SERIALIZATION_LIBRARY_TYPE.gson) { + supportingFiles.add(new SupportingFile("infrastructure/DateAdapter.kt.mustache", infrastructureFolder, + "DateAdapter.kt")); + } } else if (MULTIPLATFORM.equals(getLibrary())) { additionalProperties.put(MULTIPLATFORM, true); @@ -287,15 +293,20 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { CodegenModel cm = (CodegenModel) mo.get("model"); // escape the variable base name for use as a string literal - if (cm.requiredVars != null) { - for (CodegenProperty var : cm.requiredVars) { - var.vendorExtensions.put(VENDOR_EXTENSION_BASE_NAME_LITERAL, var.baseName.replace("$", "\\$")); - } - } - if (cm.optionalVars != null) { - for (CodegenProperty var : cm.optionalVars) { - var.vendorExtensions.put(VENDOR_EXTENSION_BASE_NAME_LITERAL, var.baseName.replace("$", "\\$")); - } + List vars = Stream.of( + cm.vars, + cm.allVars, + cm.optionalVars, + cm.requiredVars, + cm.readOnlyVars, + cm.readWriteVars, + cm.parentVars + ) + .flatMap(List::stream) + .collect(Collectors.toList()); + + for (CodegenProperty var : vars) { + var.vendorExtensions.put(VENDOR_EXTENSION_BASE_NAME_LITERAL, var.baseName.replace("$", "\\$")); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 7bdc0495430..a64ffc12eaa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -22,6 +22,7 @@ import com.samskivert.mustache.Template; import com.samskivert.mustache.Mustache.Lambda; import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; @@ -63,6 +64,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String SERVICE_IMPLEMENTATION = "serviceImplementation"; public static final String REACTIVE = "reactive"; public static final String INTERFACE_ONLY = "interfaceOnly"; + public static final String DELEGATE_PATTERN = "delegatePattern"; private String basePackage; private String invokerPackage; @@ -77,6 +79,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen private boolean serviceImplementation = false; private boolean reactive = false; private boolean interfaceOnly = false; + private boolean delegatePattern = false; public KotlinSpringServerCodegen() { super(); @@ -125,6 +128,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen addSwitch(USE_BEANVALIDATION, "Use BeanValidation API annotations to validate data types", useBeanValidation); addSwitch(REACTIVE, "use coroutines for reactive behavior", reactive); addSwitch(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.", interfaceOnly); + addSwitch(DELEGATE_PATTERN, "Whether to generate the server files using the delegate pattern", delegatePattern); supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application."); setLibrary(SPRING_BOOT); @@ -214,6 +218,10 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen this.interfaceOnly = interfaceOnly; } + public void setDelegatePattern(boolean delegatePattern) { + this.delegatePattern = delegatePattern; + } + @Override public void setUseBeanValidation(boolean useBeanValidation) { this.useBeanValidation = useBeanValidation; @@ -331,15 +339,30 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen this.setInterfaceOnly(Boolean.valueOf(additionalProperties.get(INTERFACE_ONLY).toString())); } + if (additionalProperties.containsKey(DELEGATE_PATTERN)) { + this.setDelegatePattern(Boolean.valueOf(additionalProperties.get(DELEGATE_PATTERN).toString())); + if (!this.interfaceOnly) { + this.setSwaggerAnnotations(true); + } + } + modelTemplateFiles.put("model.mustache", ".kt"); - if (interfaceOnly) { + if (!this.interfaceOnly && this.delegatePattern) { + apiTemplateFiles.put("apiInterface.mustache", ".kt"); + apiTemplateFiles.put("apiController.mustache", "Controller.kt"); + } else if (interfaceOnly) { apiTemplateFiles.put("apiInterface.mustache", ".kt"); } else { apiTemplateFiles.put("api.mustache", ".kt"); apiTestTemplateFiles.put("api_test.mustache", ".kt"); } + if (SPRING_BOOT.equals(library)) { + supportingFiles.add(new SupportingFile("apiUtil.mustache", + (sourceFolder + File.separator + apiPackage).replace(".", java.io.File.separator), "ApiUtil.kt")); + } + if (this.serviceInterface) { apiTemplateFiles.put("service.mustache", "Service.kt"); } else if (this.serviceImplementation) { @@ -349,6 +372,11 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen apiTemplateFiles.put("serviceImpl.mustache", "ServiceImpl.kt"); } + if (this.delegatePattern) { + additionalProperties.put("isDelegate", "true"); + apiTemplateFiles.put("apiDelegate.mustache", "Delegate.kt"); + } + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); @@ -373,6 +401,12 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen // spring uses the jackson lib, and we disallow configuration. additionalProperties.put("jackson", "true"); + + // add lambda for mustache templates + additionalProperties.put("lambdaEscapeDoubleQuote", + (Mustache.Lambda) (fragment, writer) -> writer.write(fragment.execute().replaceAll("\"", Matcher.quoteReplacement("\\\"")))); + additionalProperties.put("lambdaRemoveLineBreak", + (Mustache.Lambda) (fragment, writer) -> writer.write(fragment.execute().replaceAll("\\r|\\n", ""))); } @Override @@ -381,6 +415,31 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen .put("escapeDoubleQuote", new EscapeLambda("\"", "\\\"")); } + @Override + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { + if (library.equals(SPRING_BOOT) && this.delegatePattern) { + String basePath = resourcePath; + if (basePath.startsWith("/")) { + basePath = basePath.substring(1); + } + int pos = basePath.indexOf("/"); + if (pos > 0) { + basePath = basePath.substring(0, pos); + } + + if (basePath.equals("")) { + basePath = "default"; + } else { + co.subresourceOperation = !co.path.isEmpty(); + } + List opList = operations.computeIfAbsent(basePath, k -> new ArrayList<>()); + opList.add(co); + co.baseName = basePath; + } else { + super.addOperationToGroup(tag, resourcePath, operation, co, operations); + } + } + @Override public void preprocessOpenAPI(OpenAPI openAPI) { super.preprocessOpenAPI(openAPI); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java index 81d413b2169..ec9cd9f2bf2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java @@ -19,8 +19,11 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,6 +66,8 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen additionalProperties.put("apiPackage", apiPackage); + // Explicitly defining bulid.properties helps guarantee our sample remains compilable against the embedded target 2.11 scala + supportingFiles.add(new SupportingFile("build.properties.mustache", "", "project/build.properties")); supportingFiles.add(new SupportingFile("build.sbt.mustache", "", "build.sbt")); supportingFiles.add(new SupportingFile("dateTimeCodecs.mustache", (sourceFolder + File.separator + apiPackage).replace(".", File.separator), "DateTimeCodecs.scala")); supportingFiles.add(new SupportingFile("HelperCodecs.mustache", (sourceFolder + File.separator + apiPackage).replace(".", File.separator), "HelperCodecs.scala")); @@ -71,10 +76,16 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen importMapping.remove("List"); importMapping.remove("Set"); importMapping.remove("Map"); - - importMapping.put("Date", "java.util.Date"); + importMapping.put("ListBuffer", "scala.collection.mutable.ListBuffer"); + // Overrides defaults applied in DefaultCodegen which don't apply cleanly to Scala. + importMapping.put("Date", "java.util.Date"); + importMapping.put("DateTime", "org.joda.time.DateTime"); + importMapping.put("LocalDateTime", "org.joda.time.LocalDateTime"); + importMapping.put("LocalDate", "org.joda.time.LocalDate"); + importMapping.put("LocalTime", "org.joda.time.LocalTime"); + typeMapping = new HashMap(); typeMapping.put("enum", "NSString"); typeMapping.put("array", "List"); @@ -179,6 +190,42 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen } + @Override + public String toDefaultValue(Schema p) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } + + // comment out the following as the default value is no handled differently + if (ModelUtils.isBooleanSchema(p)) { + return null; + } else if (ModelUtils.isDateSchema(p)) { + return null; + } else if (ModelUtils.isDateTimeSchema(p)) { + return null; + } else if (ModelUtils.isNumberSchema(p)) { + return null; + } else if (ModelUtils.isIntegerSchema(p)) { + return null; + } else if (ModelUtils.isMapSchema(p)) { + String inner = getSchemaType(ModelUtils.getAdditionalProperties(p)); + + return "Map.empty[String, " + inner + "] "; + } else if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + String inner = getSchemaType(ap.getItems()); + String collectionType = typeMapping.get("array"); + + // We assume that users would map these collections to a monoid with an identity function + // There's no reason to assume mutable structure here (which may make consumption more difficult) + return collectionType + ".empty[" + inner + "] "; + } else if (ModelUtils.isStringSchema(p)) { + return null; + } else { + return null; + } + } + @Override public CodegenType getTag() { return CodegenType.CLIENT; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index ff0f6e679ae..96c5f9d35bd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -26,6 +26,8 @@ import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.OptionalFeatures; import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; +import org.openapitools.codegen.templating.mustache.SplitStringLambda; +import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -303,9 +305,8 @@ public class SpringCodegen extends AbstractJavaCodegen if (additionalProperties.containsKey(UNHANDLED_EXCEPTION_HANDLING)) { this.setUnhandledException(Boolean.valueOf(additionalProperties.get(UNHANDLED_EXCEPTION_HANDLING).toString())); - } else { - additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException()); } + additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException()); typeMapping.put("file", "Resource"); importMapping.put("Resource", "org.springframework.core.io.Resource"); @@ -463,6 +464,10 @@ public class SpringCodegen extends AbstractJavaCodegen (Mustache.Lambda) (fragment, writer) -> writer.write(fragment.execute().replaceAll("\"", Matcher.quoteReplacement("\\\"")))); additionalProperties.put("lambdaRemoveLineBreak", (Mustache.Lambda) (fragment, writer) -> writer.write(fragment.execute().replaceAll("\\r|\\n", ""))); + + additionalProperties.put("lambdaTrimWhitespace", new TrimWhitespaceLambda()); + + additionalProperties.put("lambdaSplitString", new SplitStringLambda()); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index c4cc372e35a..832152b8927 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -44,6 +44,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String NPM_REPOSITORY = "npmRepository"; public static final String WITH_INTERFACES = "withInterfaces"; + public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; public static final String TAGGED_UNIONS = "taggedUnions"; public static final String NG_VERSION = "ngVersion"; public static final String PROVIDED_IN_ROOT = "providedInRoot"; @@ -58,6 +59,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode protected String ngVersion = "8.0.0"; protected String npmRepository = null; + private boolean useSingleRequestParameter = false; protected String serviceSuffix = "Service"; protected String serviceFileSuffix = ".service"; protected String modelSuffix = ""; @@ -86,6 +88,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode this.cliOptions.add(CliOption.newBoolean(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", false)); + this.cliOptions.add(CliOption.newBoolean(USE_SINGLE_REQUEST_PARAMETER, + "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", + false)); this.cliOptions.add(CliOption.newBoolean(TAGGED_UNIONS, "Use discriminators to create tagged unions instead of extending interfaces.", this.taggedUnions)); @@ -163,6 +168,11 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode apiTemplateFiles.put("apiInterface.mustache", "Interface.ts"); } } + + if (additionalProperties.containsKey(USE_SINGLE_REQUEST_PARAMETER)) { + this.setUseSingleRequestParameter(convertPropertyToBoolean(USE_SINGLE_REQUEST_PARAMETER)); + } + writePropertyBack(USE_SINGLE_REQUEST_PARAMETER, getUseSingleRequestParameter()); if (additionalProperties.containsKey(TAGGED_UNIONS)) { taggedUnions = Boolean.parseBoolean(additionalProperties.get(TAGGED_UNIONS).toString()); @@ -576,6 +586,14 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode this.npmRepository = npmRepository; } + private boolean getUseSingleRequestParameter() { + return useSingleRequestParameter; + } + + private void setUseSingleRequestParameter(boolean useSingleRequestParameter) { + this.useSingleRequestParameter = useSingleRequestParameter; + } + private String getApiFilenameFromClassname(String classname) { String name = classname.substring(0, classname.length() - serviceSuffix.length()); return toApiFilename(name); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 3e27363508b..966fe262188 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -54,8 +54,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege outputFolder = "generated-code/typescript-fetch"; embeddedTemplateDir = templateDir = "typescript-fetch"; - this.apiPackage = "src" + File.separator +"apis"; - this.modelPackage = "src" + File.separator + "models"; this.apiTemplateFiles.put("apis.mustache", ".ts"); this.modelTemplateFiles.put("models.mustache", ".ts"); this.addExtraReservedWords(); @@ -98,10 +96,17 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege super.processOpts(); additionalProperties.put("isOriginalModelPropertyNaming", getModelPropertyNaming().equals("original")); additionalProperties.put("modelPropertyNaming", getModelPropertyNaming()); - supportingFiles.add(new SupportingFile("index.mustache", "src", "index.ts")); - supportingFiles.add(new SupportingFile("runtime.mustache", "src", "runtime.ts")); - supportingFiles.add(new SupportingFile("tsconfig.mustache", "", "tsconfig.json")); - supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + + String sourceDir = ""; + if (additionalProperties.containsKey(NPM_NAME)) { + sourceDir = "src" + File.separator; + } + + this.apiPackage = sourceDir + "apis"; + this.modelPackage = sourceDir + "models"; + + supportingFiles.add(new SupportingFile("index.mustache", sourceDir, "index.ts")); + supportingFiles.add(new SupportingFile("runtime.mustache", sourceDir, "runtime.ts")); if (additionalProperties.containsKey(USE_SINGLE_REQUEST_PARAMETER)) { this.setUseSingleRequestParameter(convertPropertyToBoolean(USE_SINGLE_REQUEST_PARAMETER)); @@ -211,7 +216,9 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege //Files for building our lib supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("package.mustache", "", "package.json")); + supportingFiles.add(new SupportingFile("tsconfig.mustache", "", "tsconfig.json")); supportingFiles.add(new SupportingFile("npmignore.mustache", "", ".npmignore")); + supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/SplitStringLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/SplitStringLambda.java new file mode 100644 index 00000000000..89e99804aaf --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/SplitStringLambda.java @@ -0,0 +1,104 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * 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.codegen.templating.mustache; + +import java.io.IOException; +import java.io.Writer; +import java.util.Locale; + +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template.Fragment; + +/** + * Splits long fragments into smaller strings and uses a StringBuilder to merge + * them back. + * + * Register: + * + *
+ * additionalProperties.put("lambdaSplitString", new SplitStringLambda());
+ * 
+ * + * Use: + * + *
+ * {{#lambdaSplitString}}{{summary}}{{/lambdaSplitString}}
+ * 
+ */ +public class SplitStringLambda implements Mustache.Lambda { + private static final int DEFAULT_MAX_LENGTH = 65535; + + private static final String SPLIT_INIT = "new StringBuilder(%d)"; + + private static final String SPLIT_PART = ".append(\"%s\")"; + + private static final String SPLIT_SUFFIX = ".toString()"; + + private final int maxLength; + + public SplitStringLambda() { + this(DEFAULT_MAX_LENGTH); + } + + public SplitStringLambda(int maxLength) { + this.maxLength = maxLength; + } + + @Override + public void execute(Fragment fragment, Writer writer) throws IOException { + String input = fragment.execute(); + int inputLength = input.length(); + + StringBuilder builder = new StringBuilder(); + if (inputLength > maxLength) { + + // Initialize a StringBuilder + builder.append(String.format(Locale.ROOT, SPLIT_INIT, inputLength)); + + int currentPosition = 0; + int currentStringLength = 0; + char currentLastChar = '\\'; + + // Split input into parts of at most maxLength and not ending with an escape character + // Append each part to the StringBuilder + while (currentPosition + maxLength < input.length()) { + currentStringLength = maxLength; + currentLastChar = input.charAt(currentPosition + currentStringLength - 1); + if (currentLastChar == '\\') { + --currentStringLength; + } + + builder.append(String.format(Locale.ROOT, SPLIT_PART, input.substring(currentPosition, currentPosition + currentStringLength))); + currentPosition += currentStringLength; + } + + // Append last part if necessary + if (currentPosition < input.length()) { + builder.append(String.format(Locale.ROOT, SPLIT_PART, input.substring(currentPosition))); + } + + // Close the builder and merge everything back to a string + builder.append(SPLIT_SUFFIX); + } else { + builder.append(String.format(Locale.ROOT, "\"%s\"", input)); + } + + writer.write(builder.toString()); + } + +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambda.java new file mode 100644 index 00000000000..bdf1d136534 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambda.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * 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.codegen.templating.mustache; + +import java.io.IOException; +import java.io.Writer; + +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template.Fragment; + +/** + * Replaces duplicate whitespace characters in a fragment with single space. + * + * Register: + *
+ * additionalProperties.put("lambdaTrimWhitespace", new TrimWhitespaceLambda());
+ * 
+ * + * Use: + *
+ * {{#lambdaTrimWhitespace}}{{name}}{{/lambdaTrimWhitespace}}
+ * 
+ */ +public class TrimWhitespaceLambda implements Mustache.Lambda { + private static final String SINGLE_SPACE = " "; + + private static final String WHITESPACE_REGEX = "\\s+"; + + @Override + public void execute(Fragment fragment, Writer writer) throws IOException { + writer.write(fragment.execute().replaceAll(WHITESPACE_REGEX, SINGLE_SPACE)); + } + +} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache index 16b7102fb09..060f8f75eb3 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache @@ -73,11 +73,14 @@ set(HDRS "") ## This section shows how to use the above compiled libary to compile the source files ## set source files #set(SRCS -# unit-tests/manual-PetAPI.c -# unit-tests/manual-StoreAPI.c -# unit-tests/manual-UserAPI.c -# unit-tests/manual-order.c -# unit-tests/manual-user.c) +{{#apiInfo}} +{{#apis}} +{{#operations}} +# unit-tests/manual-{{classname}}.c +{{/operations}} +{{/apis}} +{{/apiInfo}} +#) ##set header files #set(HDRS diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache index b656b40bb95..08f5bf17e00 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache @@ -14,7 +14,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} ## Installation -You'll need the `curl 7.58.0` package in order to build the API. To have code formatted nicely you also need to have uncrustify version 0.67. +You'll need the `curl 7.58.0` package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later. # Prerequisites @@ -40,11 +40,11 @@ sudo make install ``` ## Compile the sample: -This will compile the generated code and create a library in build folder which has to be linked to the codes where API will be used. +This will compile the generated code and create a library in the build folder which has to be linked to the codes where API will be used. ```bash mkdir build cd build -// To install library to specific location use following command +// To install library to specific location, use following commands cmake -DCMAKE_INSTALL_PREFIX=/pathtolocaiton .. // for normal install use following command cmake .. @@ -58,11 +58,11 @@ To compile main.c(considering the file is present in build folder) use following -L - locaiton of the library(not required if cmake with normal installation is performed) -l library name ```bash -gcc main.c -L. -lpetstore -o main +gcc main.c -L. -l{{projectName}} -o main ``` -once compile, you can run it with ``` ./main ``` +Once compiled, you can run it with ``` ./main ``` -Note: You dont need to specify includes for models and include folder seperately as they are path linked. You just have to import the api.h file in your code, the include linking will work. +Note: You don't need to specify includes for models and include folder seperately as they are path linked. You just have to import the api.h file in your code, the include linking will work. ## Author diff --git a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache index a5733e22fba..5fb59119977 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache @@ -28,6 +28,7 @@ repositories { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" + jackson_databind_version = "2.9.10.1" } dependencies { @@ -35,7 +36,7 @@ dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" - compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile 'io.github.http-builder-ng:http-builder-ng-core:1.0.3' diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 2fa65868357..47059d550b1 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -137,7 +137,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" jersey_version = "1.19.4" jodatime_version = "2.9.9" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 9c8d7a8d30e..57deb75c560 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -121,7 +121,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" google_api_client_version = "1.23.0" jersey_common_version = "2.25.1" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache index 2c1ff450e94..2af4dd8dfdb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.10" % "compile", {{/withXml}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index 7be1da91a4e..89f8be6132c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -307,7 +307,7 @@ 1.30.2 2.25.1 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index ec3b383eea0..998d6ebc8b4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -120,7 +120,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" {{#supportJava6}} jersey_version = "2.6" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index e31be933919..61f8e283787 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-json-jackson" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 31a1843080e..5a108ed6ee4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -361,7 +361,7 @@ 3.6 {{/supportJava6}} 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 {{#threetenbp}} 2.9.10 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index f045c81743e..8c545a015f4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -148,7 +148,10 @@ public class {{classname}} { {{#returnType}} return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}); {{/returnType}} - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index e45659de524..bf9f5408c2a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -120,7 +120,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" threetenbp_version = "2.9.10" resteasy_version = "3.1.3.Final" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache index bcedcaec343..95ab58d1f9d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache index 1a12889b965..16a1a3fe1fa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -295,7 +295,7 @@ 1.5.22 3.1.3.Final 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 2.9.10 {{^java8}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 5abf07fc02c..2a327daca24 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -84,7 +84,7 @@ public class ApiClient { this.separator = separator; } - private String collectionToString(Collection collection) { + private String collectionToString(Collection collection) { return StringUtils.collectionToDelimitedString(collection, separator); } } @@ -407,7 +407,7 @@ public class ApiClient { * @param values The values of the parameter. * @return String representation of the parameter */ - public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { // create the value based on the collection format if (CollectionFormat.MULTI.equals(collectionFormat)) { // not valid for path params diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 64655e429d8..dc6d434c3e4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -116,7 +116,7 @@ public class {{classname}} { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} + final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{#hasMore}} {{/hasMore}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} @@ -130,7 +130,7 @@ public class {{classname}} { {{/hasMore}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}} {{#formParams}}if ({{paramName}} != null) - formParams.add("{{baseName}}", {{#isFile}}new FileSystemResource({{paramName}}){{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}} + formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}put{{/collectionFormat}}("{{baseName}}", {{#isFile}}new FileSystemResource({{paramName}}){{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}} {{/hasMore}}{{/formParams}}{{/hasFormParams}} final String[] accepts = { {{#hasProduces}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index 7601a8180d1..1c631f1a557 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -121,7 +121,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index a717eb44127..eb3ddfb12f9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -310,7 +310,7 @@ 1.5.22 4.3.9.RELEASE 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index e7f778ba5a0..ddeb061cd02 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -132,7 +132,7 @@ ext { {{/play25}} {{#play26}} jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" play_version = "2.6.7" {{/play26}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index c6fc88aa0aa..ecae66c6a85 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -25,7 +25,7 @@ lazy val root = (project in file(".")). "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", {{/play25}} {{#play26}} "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index d32445d02f1..428e4203763 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -375,7 +375,7 @@ 1.8.3 1.5.22 {{#usePlayWS}} - 2.9.10 + 2.9.10.1 {{#play24}} 2.6.6 2.4.11 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index 68dce22f06a..862aee9f785 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -29,7 +29,7 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" vertx_version = "3.4.2" junit_version = "4.12" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index df558861387..cdbb87d1800 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -290,7 +290,7 @@ 3.4.2 1.5.22 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 4.12 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index fe6c6d14cb1..013ab6dc0e5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -76,7 +76,7 @@ public class ApiClient { this.separator = separator; } - private String collectionToString(Collection collection) { + private String collectionToString(Collection collection) { return StringUtils.collectionToDelimitedString(collection, separator); } } @@ -513,6 +513,7 @@ public class ApiClient { * @param the return type to use * @param path The sub-path of the HTTP URL * @param method The request method + * @param pathParams The path parameters * @param queryParams The query parameters * @param body The request body object * @param headerParams The header parameters @@ -523,8 +524,8 @@ public class ApiClient { * @param returnType The return type into which to deserialize the response * @return The response body in chosen type */ - public Mono invokeAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { - final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + public Mono invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); return requestBuilder.retrieve().bodyToMono(returnType); } @@ -534,6 +535,7 @@ public class ApiClient { * @param the return type to use * @param path The sub-path of the HTTP URL * @param method The request method + * @param pathParams The path parameters * @param queryParams The query parameters * @param body The request body object * @param headerParams The header parameters @@ -544,12 +546,12 @@ public class ApiClient { * @param returnType The return type into which to deserialize the response * @return The response body in chosen type */ - public Flux invokeFluxAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { - final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + public Flux invokeFluxAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); return requestBuilder.retrieve().bodyToFlux(returnType); } - private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames) { + private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames) { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); @@ -569,7 +571,7 @@ public class ApiClient { builder.queryParams(queryParams); } - final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.build(true).toUri()); + final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.encode().toUriString(), pathParams); if(accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache index 9d7c243fe07..96066577b0e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache @@ -67,11 +67,10 @@ public class {{classname}} { if ({{paramName}} == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}}{{#hasPathParams}} + {{/required}}{{/allParams}} // create path and map variables - final Map uriVariables = new HashMap();{{#pathParams}} - uriVariables.put("{{baseName}}", {{{paramName}}});{{/pathParams}}{{/hasPathParams}} - String path = UriComponentsBuilder.fromPath("{{{path}}}"){{#hasPathParams}}.buildAndExpand(uriVariables){{/hasPathParams}}{{^hasPathParams}}.build(){{/hasPathParams}}.toUriString(); + final Map pathParams = new HashMap();{{#hasPathParams}}{{#pathParams}} + pathParams.put("{{baseName}}", {{{paramName}}});{{/pathParams}}{{/hasPathParams}} final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -89,7 +88,7 @@ public class {{classname}} { {{/hasMore}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}} {{#formParams}}if ({{paramName}} != null) - formParams.add("{{baseName}}", {{#isFile}}new FileSystemResource({{paramName}}){{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}} + formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}new FileSystemResource({{paramName}}){{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}} {{/hasMore}}{{/formParams}}{{/hasFormParams}} final String[] accepts = { {{#hasProduces}} @@ -104,7 +103,7 @@ public class {{classname}} { String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; {{#returnType}}ParameterizedTypeReference<{{#isListContainer}}{{{returnBaseType}}}{{/isListContainer}}{{^isListContainer}}{{{returnType}}}{{/isListContainer}}> returnType = new ParameterizedTypeReference<{{#isListContainer}}{{{returnBaseType}}}{{/isListContainer}}{{^isListContainer}}{{{returnType}}}{{/isListContainer}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};{{/returnType}} - return apiClient.{{#isListContainer}}invokeFluxAPI{{/isListContainer}}{{^isListContainer}}invokeAPI{{/isListContainer}}(path, HttpMethod.{{httpMethod}}, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.{{#isListContainer}}invokeFluxAPI{{/isListContainer}}{{^isListContainer}}invokeAPI{{/isListContainer}}("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 4b11dd276bb..f32f6ee5f45 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -142,7 +142,7 @@ UTF-8 1.5.22 - 5.0.7.RELEASE + 5.0.8.RELEASE 2.9.10 2.9.10.1 0.2.0 diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 1ec15aa3984..9814954cc4b 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -231,7 +231,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela @Override public boolean equals(java.lang.Object o) { {{#useReflectionEqualsHashCode}} - return EqualsBuilder.reflectionEquals(this, o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); {{/useReflectionEqualsHashCode}} {{^useReflectionEqualsHashCode}} if (this == o) { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache index a81ab0fbed0..4ea71205974 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache @@ -10,7 +10,7 @@ UTF-8 2.22.0 true - 0.25.0 + 0.27.0 3.8.1 1.8 UTF-8 @@ -105,21 +105,6 @@ - - io.quarkus - quarkus-maven-plugin - ${quarkus.version} - - - - native-image - - - true - - - - maven-failsafe-plugin ${surefire-plugin.version} @@ -139,6 +124,9 @@ + + native + diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/exampleString.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/exampleString.mustache new file mode 100644 index 00000000000..1f72a330ef6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/exampleString.mustache @@ -0,0 +1 @@ +{{#lambdaSplitString}}{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{#lambdaTrimWhitespace}}{{{example}}}{{/lambdaTrimWhitespace}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}{{/lambdaSplitString}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index 842a9926d18..156ba47b04d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -248,7 +248,7 @@ org.springframework.hateoas spring-hateoas - 0.25.0.RELEASE + 1.0.1.RELEASE {{/hateoas}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache index 40b041331ce..e71414e99e1 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache @@ -8,7 +8,8 @@ return CompletableFuture.supplyAsync(()-> { {{#async}} {{/async}} {{/jdk8}}for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { {{/-first}} {{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { -{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} ApiUtil.setExampleResponse(request, "{{{contentType}}}", "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{example}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}"); +{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} String exampleString = {{>exampleString}}; +{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} ApiUtil.setExampleResponse(request, "{{{contentType}}}", exampleString); {{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} break; {{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} } {{#-last}} @@ -36,7 +37,8 @@ Mono result = Mono.empty(); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { {{/-first}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { - result = ApiUtil.getExampleResponse(exchange, "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{example}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}"); + String exampleString = {{>exampleString}}; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } {{#-last}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache index 60d7d41fe48..fbe3a9f1445 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache @@ -25,7 +25,7 @@ import javax.xml.bind.annotation.*; {{/withXml}} {{^parent}} {{#hateoas}} -import org.springframework.hateoas.ResourceSupport; +import org.springframework.hateoas.RepresentationModel; {{/hateoas}} {{/parent}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 29c35fbc1d7..5ccc8a8c936 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -3,7 +3,7 @@ */{{#description}} @ApiModel(description = "{{{description}}}"){{/description}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}}{{#hateoas}}extends ResourceSupport {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}}{{#hateoas}}extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache index a1ada999736..143ca85238c 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache @@ -23,5 +23,5 @@ export type {{classname}} = { */ {{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; {{/vars}} -} +}{{#parent}} & {{parent}}{{/parent}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache index 425cb563715..99cd8d8f664 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache @@ -8,7 +8,7 @@ :keywords: openapi, rest, {{appName}} :specDir: {{specDir}} :snippetDir: {{snippetDir}} -:generator-template: v1 2019-09-03 +:generator-template: v1 2019-11-10 :info-url: {{infoUrl}} :app-name: {{appName}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache index b36b7227c19..c5f93d6afdb 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache @@ -5,7 +5,7 @@ {{#model}} [#{{classname}}] -==== _{{classname}}_ {{title}} +=== _{{classname}}_ {{title}} {{unescapedDescription}} @@ -15,11 +15,11 @@ | Field Name| Required| Type| Description| Format {{#vars}} -| {{name}} +| {{baseName}} | {{#required}}X{{/required}} | {{dataType}} {{#isContainer}} of <<{{complexType}}>>{{/isContainer}} | {{description}} -| {{{dataFormat}}} {{#isEnum}}Enum: _ {{#_enum}}{{this}}, {{/_enum}}{{/isEnum}} _ +| {{{dataFormat}}} {{#isEnum}}_Enum:_ {{#_enum}}{{this}}, {{/_enum}}{{/isEnum}} {{/vars}} |=== diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache index 863c7294891..563e7976fdf 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache @@ -1,4 +1,4 @@ -| {{paramName}} +| {{baseName}} | {{description}} {{#baseType}}<<{{baseType}}>>{{/baseType}} | {{^required}}-{{/required}}{{#required}}X{{/required}} | {{defaultValue}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache index 99492c9a604..19a6acbc53e 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache @@ -33,9 +33,15 @@ namespace {{apiPackage}} /// {{description}}{{/allParams}}{{#responses}} /// {{message}}{{/responses}} [{{httpMethod}}] - [Route("{{{basePathWithoutHost}}}{{{path}}}")]{{#hasAuthMethods}}{{#authMethods}}{{#isApiKey}} - [Authorize(Policy = "{{name}}")]{{/isApiKey}}{{#isBasicBearer}} - [Authorize{{#hasScopes}}(Roles = "{{#scopes}}{{scope}}{{#hasMore}},{{/hasMore}}{{/scopes}}"){{/hasScopes}}]{{/isBasicBearer}}{{/authMethods}}{{/hasAuthMethods}} + [Route("{{{basePathWithoutHost}}}{{{path}}}")] +{{#authMethods}} +{{#isApiKey}} + [Authorize(Policy = "{{name}}")] +{{/isApiKey}} +{{#isBasicBearer}} + [Authorize{{#scopes}}{{#-first}}(Roles = "{{/-first}}{{scope}}{{^-last}},{{/-last}}{{#-last}}"){{/-last}}{{/scopes}}] +{{/isBasicBearer}} +{{/authMethods}} [ValidateModelState]{{#useSwashbuckle}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache b/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache new file mode 100644 index 00000000000..940ebbc0fa4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache @@ -0,0 +1,60 @@ +# {{kebabName}}-openapi-generator + +## Requirements + +* Gradle 5.x +* Java 8+ + +## Getting Started + +* Initialize the gradle wrapper: + ```bash + gradle wrapper --gradle-version 5.6.2 + ``` +* Modify the codegen class and associated templates +* Compile with `./gradlew standalone` +* Verify: + ```bash + java -jar build/libs/{{kebabName}}-openapi-generator-standalone.jar config-help -g {{name}} + ``` + +## Building + +### Standalone + +As seen in "Getting Started", the generator may be built as a standalone customized version of OpenAPI Generator's CLI. This may be the simplest option for developers who are unfamiliar with working in the JVM. Please be aware of any licensing concerns before distributing this "uber-jar". + +To build as a standalone, run: + +```bash +./gradlew standalone +``` + +To list generators via OpenAPI Generator CLI: + +```bash +java -jar build/libs/{{kebabName}}-openapi-generator-standalone.jar list --include all +``` + +### ShadowJar + +This generator supports building as a lightweight "fat-jar". This option includes Kotlin or any other `implementation` dependencies you'll add. This will simplify publishing if your generator has many dependencies. + +To build as a shadowJar, run: + +```bash +./gradlew shadowJar +``` + +To list generators via OpenAPI Generator CLI, you must refer to the CLI jar explicitly. We add a custom copy task which includes the CLI jar in the build output directory: + +```bash +java -cp build/libs/openapi-generator-cli-4.1.3.jar:build/libs/{{kebabName}}-openapi-generator-1.0-SNAPSHOT-all.jar org.openapitools.codegen.OpenAPIGenerator list +``` + +Notice that this command _must_ pass classpath via `-cp` and include OpenAPI Generator CLI as well as the artifact built from this project. Also notice that the manifest class must be passed explicitly as `org.openapitools.codegen.OpenAPIGenerator`. + +## See Also + +* [Customization docs](https://openapi-generator.tech/docs/customization) +* [Templating docs](https://openapi-generator.tech/docs/templating) diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/build_gradle.mustache b/modules/openapi-generator/src/main/resources/codegen/kotlin/build_gradle.mustache new file mode 100644 index 00000000000..60ec7dd944f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/build_gradle.mustache @@ -0,0 +1,62 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") version "1.3.41" + id("com.github.johnrengelman.shadow") version("5.0.0") +} + +group = "org.openapitools" +version = "1.0-SNAPSHOT" + +repositories { + mavenLocal() + mavenCentral() +} + +dependencies { + val openapiGeneratorVersion = "4.1.3" + + implementation(kotlin("stdlib-jdk8")) + implementation("org.openapitools:openapi-generator:$openapiGeneratorVersion") + + runtime("org.openapitools:openapi-generator-cli:$openapiGeneratorVersion") + + testImplementation("org.junit.jupiter:junit-jupiter:5.5.2") +} + +tasks.test { + useJUnitPlatform() + testLogging { + events("passed", "skipped", "failed") + } +} + +tasks.register("copyToLib") { + from(project.configurations.runtime) + into(File(buildDir, "libs")) +} + +tasks.register("standalone") { + archiveFileName.set("{{name}}-openapi-generator-standalone.jar") + archiveClassifier.set("all") + + from(sourceSets["main"].output) + + configurations.add(project.configurations["runtimeClasspath"]) + configurations.add(project.configurations["runtime"]) + + mergeServiceFiles() + + manifest.attributes(mapOf("Main-Class" to "org.openapitools.codegen.OpenAPIGenerator")) +} + +tasks.withType { + kotlinOptions.jvmTarget = "1.8" +} + +tasks.wrapper { + this.distributionType = Wrapper.DistributionType.BIN +} + +tasks.named("shadowJar") { dependsOn("copyToLib") } diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/generatorClass.mustache b/modules/openapi-generator/src/main/resources/codegen/kotlin/generatorClass.mustache new file mode 100644 index 00000000000..b65939e23f7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/generatorClass.mustache @@ -0,0 +1,183 @@ +@file:JvmName("{{generatorClass}}") +package {{generatorPackage}} + +import org.openapitools.codegen.* + +import java.util.* +import java.io.File + +open class {{generatorClass}}() : DefaultCodegen(), CodegenConfig { + + // source folder where files are written + private var sourceFolder = "src" + private var apiVersion = "1.0.0" + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see org.openapitools.codegen.CodegenType + */ + override fun getTag(): CodegenType { + return CodegenType.{{generatorType}} + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + override fun getName(): String { + return "{{name}}" + } + + /** + * Provides an opportunity to inspect and modify operation data before the code is generated. + */ + @Suppress("UNCHECKED_CAST") + override fun postProcessOperationsWithModels(objs: Map, allModels: List?): Map { + val results = super.postProcessOperationsWithModels(objs, allModels) + + val ops = results["operations"] as Map + val opList = ops["operation"] as ArrayList + + // iterate over the operation and perhaps modify something + for (co: CodegenOperation in opList) { + // example: + // co.httpMethod = co.httpMethod.toLowerCase(); + } + + return results + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + override fun getHelp(): String { + return "Generates a {{name}} client library." + } + + init { + // set the output folder here + outputFolder = "generated-code/{{name}}" + + /** + * Models. You can write model files using the modelTemplateFiles map. + * if you want to create one template for file, you can do so here. + * for multiple files for model, just put another entry in the `modelTemplateFiles` with + * a different extension + */ + modelTemplateFiles["model.mustache"] = ".sample" // the extension for each file to write + + /** + * Api classes. You can write classes for each Api file with the apiTemplateFiles map. + * as with models, add multiple entries with different extensions for multiple files per + * class + */ + apiTemplateFiles["api.mustache"] = ".sample" // the extension for each file to write + + /** + * Template Location. This is the location which templates will be read from. The generator + * will use the resource stream to attempt to read the templates. + */ + templateDir = "{{name}}" + + /** + * Api Package. Optional, if needed, this can be used in templates + */ + apiPackage = "org.openapitools.api" + + /** + * Model Package. Optional, if needed, this can be used in templates + */ + modelPackage = "org.openapitools.model" + + /** + * Reserved words. Override this with reserved words specific to your language + */ + reservedWords = HashSet( + listOf("sample1", "sample2") + ) + + /** + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties["apiVersion"] = apiVersion + + /** + * Supporting Files. You can write single files for the generator with the + * entire object tree available. If the input file has a suffix of `.mustache + * it will be processed by the template engine. Otherwise, it will be copied + */ + supportingFiles.add( + SupportingFile( + "myFile.mustache", // the input template or file + "", // the destination folder, relative `outputFolder` + "myFile.sample" + ) // the output file + ) + + /** + * Language Specific Primitives. These types will not trigger imports by + * the client generator + */ + languageSpecificPrimitives = HashSet( + listOf("Type1", "Type2") + ) + } + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping + * those terms here. This logic is only called if a variable matches the reserved words + * + * @return the escaped term + */ + override fun escapeReservedWord(name: String?): String { + // add an underscore to the name if it exists. + return if (name == null) "" else "_$name" + } + + /** + * Location to write model files. You can use the modelPackage() as defined when the class is + * instantiated + */ + override fun modelFileFolder(): String { + return """$outputFolder/$sourceFolder/${modelPackage().replace('.', File.separatorChar)}""" + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + override fun apiFileFolder(): String { + return """$outputFolder/$sourceFolder/${apiPackage().replace('.', File.separatorChar)}""" + } + + /** + * override with any special text escaping logic to handle unsafe + * characters so as to avoid code injection + * + * @param input String to be cleaned up + * @return string with unsafe characters removed or escaped + */ + override fun escapeUnsafeCharacters(input: String): String { + //TODO: check that this logic is safe to escape unsafe characters to avoid code injection + return input + } + + /** + * Escape single and/or double quote to avoid code injection + * + * @param input String to be cleaned up + * @return string with quotation mark removed or escaped + */ + override fun escapeQuotationMark(input: String): String { + //TODO: check that this logic is safe to escape quotation mark to avoid code injection + return with(input) { replace("\"", "\\\"") } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/generatorClassTest.mustache b/modules/openapi-generator/src/main/resources/codegen/kotlin/generatorClassTest.mustache new file mode 100644 index 00000000000..c1276791bcc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/generatorClassTest.mustache @@ -0,0 +1,26 @@ +package {{generatorPackage}} + +import org.junit.jupiter.api.Assertions.* +import org.junit.jupiter.api.Test +import org.openapitools.codegen.ClientOptInput +import org.openapitools.codegen.DefaultGenerator +import org.openapitools.codegen.config.CodegenConfigurator + +internal class {{generatorClass}}Test { + + // use this test to launch you code generator in the debugger. + // this allows you to easily set break points in MyclientcodegenGenerator. + @Test + fun launchCodeGenerator() { + // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + val configurator: CodegenConfigurator = CodegenConfigurator() + .setGeneratorName("{{name}}") + .setInputSpec("https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server + .setOutputDir("out/{{name}}") + + val clientOptInput: ClientOptInput = configurator.toClientOptInput() + val generator = DefaultGenerator() + generator.opts(clientOptInput).generate() + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/gradle.properties b/modules/openapi-generator/src/main/resources/codegen/kotlin/gradle.properties new file mode 100644 index 00000000000..7fc6f1ff272 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/settings.mustache b/modules/openapi-generator/src/main/resources/codegen/kotlin/settings.mustache new file mode 100644 index 00000000000..42398131381 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/settings.mustache @@ -0,0 +1 @@ +rootProject.name = '{{kebabName}}-openapi-generator' diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache index 2ad6f17868f..8fc1b19b7e7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.2) project(api-server) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pg -g3" ) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pg -g3" ) {{#addExternalLibs}} include(ExternalProject) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache index 58f2398dfeb..6670c2e0abf 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache @@ -8,6 +8,7 @@ #include #include #include +#include #include "{{prefix}}HttpRequest.h" @@ -47,23 +48,15 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f {{prefix}}HttpRequestWorker::{{prefix}}HttpRequestWorker(QObject *parent) - : QObject(parent), manager(nullptr) + : QObject(parent), manager(nullptr), _timeOut(0) { qsrand(QDateTime::currentDateTime().toTime_t()); - timeout = 0; - timer = new QTimer(); manager = new QNetworkAccessManager(this); workingDirectory = QDir::currentPath(); connect(manager, &QNetworkAccessManager::finished, this, &{{prefix}}HttpRequestWorker::on_manager_finished); } {{prefix}}HttpRequestWorker::~{{prefix}}HttpRequestWorker() { - if(timer != nullptr){ - if(timer->isActive()){ - timer->stop(); - } - timer->deleteLater(); - } for (const auto & item: multiPartFields) { if(item != nullptr) { delete item; @@ -83,7 +76,7 @@ QMap {{prefix}}HttpRequestWorker::getResponseHeaders() const { return files[fieldname]; } } - return OAIHttpFileElement(); + return {{prefix}}HttpFileElement(); } QByteArray *{{prefix}}HttpRequestWorker::getMultiPartField(const QString &fieldname){ @@ -97,8 +90,8 @@ QByteArray *{{prefix}}HttpRequestWorker::getMultiPartField(const QString &fieldn return nullptr; } -void {{prefix}}HttpRequestWorker::setTimeOut(int tout){ - timeout = tout; +void {{prefix}}HttpRequestWorker::setTimeOut(int timeOut){ + _timeOut = timeOut; } void {{prefix}}HttpRequestWorker::setWorkingDirectory(const QString &path){ @@ -358,11 +351,8 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { buffer->setParent(reply); #endif } - if(timeout > 0){ - timer->setSingleShot(true); - timer->setInterval(timeout); - connect(timer, &QTimer::timeout, this, [=](){ on_manager_timeout(reply); }); - timer->start(); + if(_timeOut > 0){ + QTimer::singleShot(_timeOut, [=](){ on_manager_timeout(reply); }); } } diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache index 5138113d7dc..435d43d20ca 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache @@ -10,12 +10,10 @@ #include #include -#include #include #include #include - #include "{{prefix}}HttpFileElement.h" {{#cppNamespaceDeclarations}} @@ -52,7 +50,6 @@ public: QByteArray response; QNetworkReply::NetworkError error_type; QString error_str; - QTimer *timer; explicit {{prefix}}HttpRequestWorker(QObject *parent = nullptr); virtual ~{{prefix}}HttpRequestWorker(); @@ -70,10 +67,10 @@ signals: private: QNetworkAccessManager *manager; QMap headers; - QMap files; + QMap files; QMap multiPartFields; QString workingDirectory; - int timeout; + int _timeOut; void on_manager_timeout(QNetworkReply *reply); void process_form_response(); private slots: diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache index 9b5d5973b1a..a4d19e34626 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache @@ -9,49 +9,55 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} -{{classname}}::{{classname}}() : basePath("{{{basePathWithoutHost}}}"), - host("{{#serverHost}}{{#scheme}}{{scheme}}://{{/scheme}}{{serverHost}}{{#serverPort}}:{{serverPort}}{{/serverPort}}{{/serverHost}}"), - timeout(0){ - +{{classname}}::{{classname}}(const QString &scheme, const QString &host, int port, const QString& basePath, const int timeOut) : + _scheme(scheme), + _host(host), + _port(port), + _basePath(basePath), + _timeOut(timeOut) { } {{classname}}::~{{classname}}() { - } -{{classname}}::{{classname}}(const QString& host, const QString& basePath, const int tout) { - this->host = host; - this->basePath = basePath; - this->timeout = tout; -} - -void {{classname}}::setBasePath(const QString& basePath){ - this->basePath = basePath; +void {{classname}}::setScheme(const QString& scheme){ + _scheme = scheme; } void {{classname}}::setHost(const QString& host){ - this->host = host; + _host = host; } -void {{classname}}::setApiTimeOutMs(const int tout){ - timeout = tout; +void {{classname}}::setPort(int port){ + _port = port; +} + +void {{classname}}::setBasePath(const QString& basePath){ + _basePath = basePath; +} + +void {{classname}}::setTimeOut(const int timeOut){ + _timeOut = timeOut; } void {{classname}}::setWorkingDirectory(const QString& path){ - workingDirectory = path; + _workingDirectory = path; } void {{classname}}::addHeaders(const QString& key, const QString& value){ defaultHeaders.insert(key, value); } - {{#operations}} {{#operation}} void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}}& {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("{{{path}}}"); + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("{{{path}}}"); {{#pathParams}} QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{baseName}}").append("}"); @@ -107,8 +113,8 @@ void } {{/collectionFormat}}{{/queryParams}} {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); {{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}"); {{#formParams}}{{^isFile}} input.add_var("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));{{/isFile}}{{#isFile}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache index aca810bfb78..9595c57d903 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache @@ -17,23 +17,23 @@ class {{classname}}: public QObject { Q_OBJECT public: - {{classname}}(); - {{classname}}(const QString& host, const QString& basePath, const int toutMs = 0); + {{classname}}(const QString &scheme = "{{scheme}}", const QString &host = "{{serverHost}}", int port = {{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}0{{/serverPort}}, const QString& basePath = "{{basePathWithoutHost}}", const int timeOut = 0); ~{{classname}}(); + void setScheme(const QString &scheme); + void setHost(const QString &host); + void setPort(int port); void setBasePath(const QString& basePath); - void setHost(const QString& host); - void setApiTimeOutMs(const int tout); + void setTimeOut(const int timeOut); void setWorkingDirectory(const QString& path); void addHeaders(const QString& key, const QString& value); {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}const {{{dataType}}}& {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}}{{/operations}} private: - QString basePath; - QString host; - QString workingDirectory; - int timeout; + QString _scheme, _host, _basePath; + int _port, _timeOut; + QString _workingDirectory; QMap defaultHeaders; {{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker); {{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-header.mustache index f5275022a71..d68d1d23a89 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-header.mustache @@ -20,6 +20,27 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} + template QString + toStringValue(const QList &val); + + template + bool fromStringValue(const QList &inStr, QList &val); + + template + bool fromStringValue(const QMap &inStr, QMap &val); + + template + QJsonValue toJsonValue(const QList &val); + + template + QJsonValue toJsonValue(const QMap &val); + + template + bool fromJsonValue(QList &val, const QJsonValue &jval); + + template + bool fromJsonValue(QMap &val, const QJsonValue &jval); + QString toStringValue(const QString &value); QString toStringValue(const QDateTime &value); QString toStringValue(const QByteArray &value); @@ -30,8 +51,8 @@ namespace {{this}} { QString toStringValue(const float &value); QString toStringValue(const double &value); QString toStringValue(const {{prefix}}Object &value); - QString toStringValue(const {{prefix}}Enum &value); - QString toStringValue(const {{prefix}}HttpFileElement &value); + QString toStringValue(const {{prefix}}Enum &value); + QString toStringValue(const {{prefix}}HttpFileElement &value); template QString toStringValue(const QList &val) { @@ -56,7 +77,7 @@ namespace {{this}} { QJsonValue toJsonValue(const double &value); QJsonValue toJsonValue(const {{prefix}}Object &value); QJsonValue toJsonValue(const {{prefix}}Enum &value); - QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value); + QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value); template QJsonValue toJsonValue(const QList &val) { @@ -86,8 +107,8 @@ namespace {{this}} { bool fromStringValue(const QString &inStr, float &value); bool fromStringValue(const QString &inStr, double &value); bool fromStringValue(const QString &inStr, {{prefix}}Object &value); - bool fromStringValue(const QString &inStr, {{prefix}}Enum &value); - bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value); + bool fromStringValue(const QString &inStr, {{prefix}}Enum &value); + bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value); template bool fromStringValue(const QList &inStr, QList &val) { @@ -122,13 +143,13 @@ namespace {{this}} { bool fromJsonValue(double &value, const QJsonValue &jval); bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval); bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval); - bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval); + bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval); template bool fromJsonValue(QList &val, const QJsonValue &jval) { bool ok = true; if(jval.isArray()){ - for(const auto& jitem : jval.toArray()){ + for(const auto jitem : jval.toArray()){ T item; ok &= fromJsonValue(item, jitem); val.push_back(item); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache index 0f71c97ca6c..ea1e8e1411b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache @@ -14,12 +14,12 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} {{classname}}::{{classname}}(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } {{classname}}::{{classname}}() { - this->init(); + this->initializeModel(); } {{classname}}::~{{classname}}() { @@ -27,15 +27,14 @@ namespace {{this}} { } void -{{classname}}::init() { +{{classname}}::initializeModel() { {{^isEnum}}{{#vars}} m_{{name}}_isSet = false; m_{{name}}_isValid = false; {{/vars}}{{/isEnum}}{{#isEnum}} m_value_isSet = false; m_value_isValid = false; - m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED; - {{/isEnum}} + m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED;{{/isEnum}} } void @@ -46,22 +45,27 @@ void this->fromJsonObject(jsonObject);{{/isEnum}}{{#isEnum}}{{#allowableValues}}{{#enumVars}} {{#-first}}if{{/-first}}{{^-first}}else if{{/-first}} ( jsonString.compare({{#isString}}"{{value}}"{{/isString}}{{^isString}}QString::number({{value}}){{/isString}}, Qt::CaseInsensitive) == 0) { m_value = e{{classname}}::{{name}}; - m_value_isValid = true; + m_value_isSet = m_value_isValid = true; }{{/enumVars}}{{/allowableValues}}{{/isEnum}} } void {{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) { - {{^isEnum}}{{#vars}} - {{^isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/isContainer}} - {{#isContainer}}{{^items.isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}} + {{^isEnum}}{{#vars}}{{^isContainer}} + m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]); + m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/isContainer}}{{#isContainer}}{{^items.isContainer}} + m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]); + m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}} if(json["{{baseName}}"].isArray()){ auto arr = json["{{baseName}}"].toArray(); m_{{name}}_isValid = true; - for (const QJsonValue & jval : arr) { - {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap{{/items.isMapContainer}} item; - m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval) - {{name}}.push_back(item); + if(arr.count() > 0) { + for (const QJsonValue jval : arr) { + {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap{{/items.isMapContainer}} item; + m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); + m_{{name}}_isSet = !jval.isNull() && m_{{name}}_isValid; + {{name}}.push_back(item); + } } }{{/isListContainer}}{{#isMapContainer}} if(json["{{baseName}}"].isObject()){ @@ -72,6 +76,7 @@ void {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap{{/items.isMapContainer}} item; auto jval = QJsonValue::fromVariant(varmap.value(val)); m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); + m_{{name}}_isSet &= !jval.isNull() && m_{{name}}_isValid; {{name}}.insert({{name}}.end(), val, item); } } diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache index 3c83c1f0d53..27a7c09c7cc 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache @@ -59,7 +59,7 @@ public: virtual bool isValid() const override; private: - void init(); + void initializeModel(); {{^isEnum}}{{#vars}} {{{dataType}}} {{name}}; bool m_{{name}}_isSet; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index e874041b3e7..58ef09e083d 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -347,7 +347,9 @@ namespace {{packageName}}.Client private ApiResponse toApiResponse({{#supportsAsync}}IRestResponse response{{/supportsAsync}}{{^supportsAsync}}IRestResponse response, CustomJsonCodec des{{/supportsAsync}}) { T result = {{#supportsAsync}}response.Data{{/supportsAsync}}{{^supportsAsync}}(T)des.Deserialize(response, typeof(T)){{/supportsAsync}}; - var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result) + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) { ErrorText = response.ErrorMessage, Cookies = new List() diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiResponse.mustache index eee53bf305d..024a6adb178 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiResponse.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiResponse.mustache @@ -42,6 +42,11 @@ namespace {{packageName}}.Client /// Gets or sets any cookies passed along on the response. /// List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } } /// @@ -94,6 +99,11 @@ namespace {{packageName}}.Client { get { return Data; } } + + /// + /// The raw content + /// + public string RawContent { get;} #endregion Properties @@ -105,11 +115,23 @@ namespace {{packageName}}.Client /// HTTP status code. /// HTTP headers. /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) { StatusCode = statusCode; Headers = headers; Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { } /// @@ -117,10 +139,18 @@ namespace {{packageName}}.Client /// /// HTTP status code. /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) { - StatusCode = statusCode; - Data = data; } #endregion Constructors diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache index 90d09845bd4..e6c220b8127 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -45,8 +45,8 @@ namespace {{packageName}}.Client if (status >= 400) { return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.Content), - response.Content); + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent); } {{^netStandard}}if (status == 0) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache index 45d075c16e8..78738eeb1f3 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache @@ -33,7 +33,7 @@ {{#description}} /// {{description}} {{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] + [DataMember(Name="{{baseName}}", EmitDefaultValue={{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/vendorExtensions.x-emit-default-value}})] public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } {{/isEnum}} {{/vars}} @@ -116,7 +116,7 @@ /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// {{#description}} /// {{description}}{{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})]{{#isDate}} + [DataMember(Name="{{baseName}}", EmitDefaultValue={{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/vendorExtensions.x-emit-default-value}})]{{#isDate}} [JsonConverter(typeof(OpenAPIDateConverter))]{{/isDate}} public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } diff --git a/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache b/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache index 141eaa307e4..dea3a0ecff1 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache @@ -2,6 +2,7 @@ library serializers; import 'package:built_value/serializer.dart'; import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; import 'package:built_value/standard_json_plugin.dart'; {{#models}}{{#model}}import 'package:{{pubName}}/model/{{classFilename}}.dart'; @@ -23,4 +24,4 @@ const FullType(BuiltList, const [const FullType({{classname}})]), ).build(); Serializers standardSerializers = -(serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); \ No newline at end of file +(serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/modules/openapi-generator/src/main/resources/dart/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/api_client.mustache index 8d3e706d3e5..05b38191c4c 100644 --- a/modules/openapi-generator/src/main/resources/dart/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/api_client.mustache @@ -141,6 +141,8 @@ class ApiClient { return client.delete(url, headers: headerParams); case "PATCH": return client.patch(url, headers: headerParams, body: msgBody); + case "HEAD": + return client.head(url, headers: headerParams); default: return client.get(url, headers: headerParams); } diff --git a/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt b/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt new file mode 100644 index 00000000000..5e51f8cceff --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt @@ -0,0 +1,69 @@ +abstract +as +assert +async +await +break +case +catch +class +const +continue +covariant +default +deferred +do +dynamic +else +enum +export +extends +extension +external +factory +false +final +finally +for +Function +get +hide +if +implements +import +in +inout +interface +is +late +library +mixin +native +new +null +of +on +operator +out +part +patch +required +rethrow +return +set +show +source +static +super +switch +sync +this +throw +true +try +typedef +var +void +while +with +yield \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart2/api_client.mustache b/modules/openapi-generator/src/main/resources/dart2/api_client.mustache index 7a668fc3147..eaa3a3ed606 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_client.mustache @@ -137,6 +137,8 @@ class ApiClient { return client.delete(url, headers: headerParams); case "PATCH": return client.patch(url, headers: headerParams, body: msgBody); + case "HEAD": + return client.head(url, headers: headerParams); default: return client.get(url, headers: headerParams); } diff --git a/modules/openapi-generator/src/main/resources/elm/model.mustache b/modules/openapi-generator/src/main/resources/elm/model.mustache index 9ac8a6c445b..cba3f3ce242 100644 --- a/modules/openapi-generator/src/main/resources/elm/model.mustache +++ b/modules/openapi-generator/src/main/resources/elm/model.mustache @@ -1,6 +1,6 @@ {{>licenseInfo}} -module Data.{{classname}} exposing ({{#models}}{{#model}}{{classname}}{{#hasChildren}}(..){{/hasChildren}}{{#isEnum}}(..){{/isEnum}}{{^isEnum}}{{#vars}}{{#isEnum}}, {{vendorExtensions.elmCustomType}}(..){{/isEnum}}{{/vars}}{{/isEnum}}, decoder, encode, toString{{/model}}{{/models}}) +module Data.{{classname}} exposing ({{#models}}{{#model}}{{classname}}{{#hasChildren}}(..){{/hasChildren}}{{#isEnum}}(..){{/isEnum}}{{^isEnum}}{{#vars}}{{#isEnum}}, {{vendorExtensions.elmCustomType}}(..){{/isEnum}}{{/vars}}{{/isEnum}}, decoder, encode{{^isEnum}}{{^discriminator}}{{^oneOf}}, encodeWithTag{{/oneOf}}{{/discriminator}}{{/isEnum}}, toString{{/model}}{{/models}}) {{>imports}}import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -14,7 +14,7 @@ import Json.Encode as Encode {-| {{{description}}} -} {{/description}} -{{#isEnum}}{{>modelTypeCustom}}{{/isEnum}}{{^isEnum}}{{#discriminator}}{{>modelTypeDiscriminator}}{{/discriminator}}{{^discriminator}}{{#isAlias}}{{>modelTypePrimitive}}{{/isAlias}}{{^isAlias}}{{#isArrayModel}}{{>modelTypeArray}}{{/isArrayModel}}{{^isArrayModel}}{{>modelTypeRecord}}{{/isArrayModel}}{{/isAlias}}{{/discriminator}}{{/isEnum}} +{{#isEnum}}{{>modelTypeCustom}}{{/isEnum}}{{^isEnum}}{{#discriminator}}{{>modelTypeDiscriminator}}{{/discriminator}}{{^discriminator}}{{#oneOf}}{{#-first}}{{>modelTypeDiscriminator}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#isAlias}}{{>modelTypePrimitive}}{{/isAlias}}{{^isAlias}}{{#isArrayModel}}{{>modelTypeArray}}{{/isArrayModel}}{{^isArrayModel}}{{>modelTypeRecord}}{{/isArrayModel}}{{/isAlias}}{{/oneOf}}{{/discriminator}}{{/isEnum}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/elm/modelTypeDiscriminator.mustache b/modules/openapi-generator/src/main/resources/elm/modelTypeDiscriminator.mustache index 0284323476c..1b9182b7424 100644 --- a/modules/openapi-generator/src/main/resources/elm/modelTypeDiscriminator.mustache +++ b/modules/openapi-generator/src/main/resources/elm/modelTypeDiscriminator.mustache @@ -1,11 +1,22 @@ type {{classname}} -{{#mappedModels}} +{{^discriminator}}{{#oneOf}} + {{#-first}}={{/-first}}{{^-first}}|{{/-first}} {{{.}}}Type {{{.}}} +{{/oneOf}}{{/discriminator}} +{{#discriminator}}{{#mappedModels}} {{#-first}}={{/-first}}{{^-first}}|{{/-first}} {{modelName}}Type {{modelName}} -{{/mappedModels}} +{{/mappedModels}}{{/discriminator}} decoder : Decoder {{classname}} decoder = +{{^discriminator}} + Decode.oneOf +{{#oneOf}} + {{#-first}}[{{/-first}}{{^-first}},{{/-first}} Decode.map {{{.}}}Type {{{.}}}.decoder +{{/oneOf}} + ] +{{/discriminator}} +{{#discriminator}} Decode.field "{{{discriminator.propertyName}}}" Decode.string |> Decode.andThen {{classVarName}}Decoder @@ -19,17 +30,25 @@ decoder = {{/mappedModels}} _ -> - Decode.fail <| "Trying to decode {{classname}}, but {{{discriminatorName}}} " ++ tag ++ " is not supported." + Decode.fail <| "Trying to decode {{classname}}, but {{{discriminatorName}}} '" ++ tag ++ "' is not supported." +{{/discriminator}} encode : {{classname}} -> Encode.Value encode model = case model of +{{^discriminator}}{{#oneOf}} + {{{.}}}Type subModel -> + {{{.}}}.encode subModel + +{{/oneOf}}{{/discriminator}} +{{#discriminator}} {{#mappedModels}} {{modelName}}Type subModel -> - {{modelName}}.encode "{{mappingName}}" subModel + {{modelName}}.encodeWithTag ("{{discriminatorName}}", "{{mappingName}}") subModel {{/mappedModels}} +{{/discriminator}} toString : {{classname}} -> String diff --git a/modules/openapi-generator/src/main/resources/elm/modelTypeRecord.mustache b/modules/openapi-generator/src/main/resources/elm/modelTypeRecord.mustache index bbe185a36ac..e267c46321c 100644 --- a/modules/openapi-generator/src/main/resources/elm/modelTypeRecord.mustache +++ b/modules/openapi-generator/src/main/resources/elm/modelTypeRecord.mustache @@ -18,7 +18,7 @@ type alias {{classname}} = toString : {{classname}} -> String toString = - Encode.encode 0 << encode{{#vendorExtensions.discriminatorName}} ""{{/vendorExtensions.discriminatorName}} + Encode.encode 0 << encode {{#vars}} diff --git a/modules/openapi-generator/src/main/resources/elm/recordEncoder.mustache b/modules/openapi-generator/src/main/resources/elm/recordEncoder.mustache index a30933a59d7..1f626719fa9 100644 --- a/modules/openapi-generator/src/main/resources/elm/recordEncoder.mustache +++ b/modules/openapi-generator/src/main/resources/elm/recordEncoder.mustache @@ -1,7 +1,16 @@ -encode : {{#vendorExtensions.discriminatorName}}String -> {{/vendorExtensions.discriminatorName}}{{classname}} -> Encode.Value -encode {{#vendorExtensions.discriminatorName}}tag {{/vendorExtensions.discriminatorName}}model = - Encode.object +encode : {{classname}} -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> {{classname}} -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : {{classname}} -> List (String, Encode.Value) +encodePairs model = {{#allVars}} - {{#-first}}[{{/-first}}{{^-first}},{{/-first}} {{>recordFieldEncoder}} -{{/allVars}}{{#vendorExtensions.discriminatorName}} , ( "{{{vendorExtensions.discriminatorName}}}", Encode.string tag ){{/vendorExtensions.discriminatorName}} - ] + {{#-first}}[{{/-first}}{{^-first}},{{/-first}} {{>recordFieldEncoder}} +{{/allVars}} + ] diff --git a/modules/openapi-generator/src/main/resources/go-experimental/client.mustache b/modules/openapi-generator/src/main/resources/go-experimental/client.mustache index ec129d3d432..cefd6c7c409 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/client.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/client.mustache @@ -339,6 +339,9 @@ func (c *APIClient) prepareRequest( } func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } if s, ok := v.(*string); ok { *s = string(b) return nil diff --git a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache index 61875a3de61..710c4088fd6 100644 --- a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache @@ -81,5 +81,5 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) }{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go-server/routers.mustache b/modules/openapi-generator/src/main/resources/go-server/routers.mustache index 941790cac37..c1b4215376e 100644 --- a/modules/openapi-generator/src/main/resources/go-server/routers.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/routers.mustache @@ -7,7 +7,9 @@ import ( "net/http" "os" "strconv" - + {{#featureCORS}} + "github.com/gorilla/handlers" + {{/featureCORS}} "github.com/gorilla/mux" ) @@ -35,6 +37,9 @@ func NewRouter(routers ...Router) *mux.Router { var handler http.Handler handler = route.HandlerFunc handler = Logger(handler, route.Name) + {{#featureCORS}} + handler = handlers.CORS()(handler) + {{/featureCORS}} router. Methods(route.Method). diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index ec129d3d432..cefd6c7c409 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -339,6 +339,9 @@ func (c *APIClient) prepareRequest( } func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } if s, ok := v.(*string); ok { *s = string(b) return nil diff --git a/modules/openapi-generator/src/main/resources/haskell-servant/API.mustache b/modules/openapi-generator/src/main/resources/haskell-servant/API.mustache index 400dee38f1d..684c469d33e 100644 --- a/modules/openapi-generator/src/main/resources/haskell-servant/API.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-servant/API.mustache @@ -61,7 +61,7 @@ import Servant.Client (ClientEnv, Scheme (Http), C mkClientEnv, parseBaseUrl) import Servant.Client.Core (baseUrlPort, baseUrlHost) import Servant.Client.Internal.HttpClient (ClientM (..)) -import Servant.Server (Handler (..)){{#serveStatic}} +import Servant.Server (Handler (..), Application){{#serveStatic}} import Servant.Server.StaticFiles (serveDirectoryFileServer){{/serveStatic}} import Web.FormUrlEncoded import Web.HttpApiData @@ -219,8 +219,8 @@ requestMiddlewareId a = a -- | Run the {{title}} server at the provided host and port. run{{title}}Server -:: (MonadIO m, MonadThrow m) -=> Config -> {{title}}Backend (ExceptT ServerError IO) -> m () + :: (MonadIO m, MonadThrow m) + => Config -> {{title}}Backend (ExceptT ServerError IO) -> m () run{{title}}Server config backend = run{{title}}MiddlewareServer config requestMiddlewareId backend -- | Run the {{title}} server at the provided host and port. diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache index d11a2ce7c89..575b55d6e57 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache @@ -17,7 +17,7 @@ UTF-8 0.1.1 2.9.10 - 2.9.10 + 2.9.10.1 1.7.21 0.5.2 4.5.3 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache index 46319b16e83..b7d8532a2fd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache @@ -24,14 +24,14 @@ import {{packageName}}.infrastructure.toMultiValue * {{summary}} * {{notes}} {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{#nullableReturnType}} or null{{/nullableReturnType}}{{/returnType}}{{^returnType}}void{{/returnType}} * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */{{#returnType}} @Suppress("UNCHECKED_CAST"){{/returnType}} @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { + fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{paramName}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mutableMapOf() {{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() @@ -62,17 +62,17 @@ import {{packageName}}.infrastructure.toMultiValue query = localVariableQuery, headers = localVariableHeaders ) - val response = request<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Any?{{/returnType}}>( + val localVarResponse = request<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Any?{{/returnType}}>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> {{#returnType}}(response as Success<*>).data as {{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} + return when (localVarResponse.responseType) { + ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache index 09ccc14758c..bd8e293b621 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache @@ -30,7 +30,7 @@ val apiInstance = {{{classname}}}() val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}val result : {{{returnType}}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} + {{#returnType}}val result : {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} println(result){{/returnType}} } catch (e: ClientException) { println("4xx response calling {{{classname}}}#{{{operationId}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache index b17954c6e14..32d352d2717 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache @@ -7,7 +7,7 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.50' repositories { mavenCentral() @@ -30,19 +30,21 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + {{#moshi}} compile "com.squareup.moshi:moshi-kotlin:1.8.0" compile "com.squareup.moshi:moshi-adapters:1.8.0" + {{/moshi}} {{#gson}} - implementation "com.google.code.gson:gson:2.8.5" + compile "com.google.code.gson:gson:2.8.6" {{/gson}} {{#jvm-okhttp3}} - compile "com.squareup.okhttp3:okhttp:3.12.4" + compile "com.squareup.okhttp3:okhttp:3.12.6" {{/jvm-okhttp3}} {{#jvm-okhttp4}} - compile "com.squareup.okhttp3:okhttp:4.2.0" + compile "com.squareup.okhttp3:okhttp:4.2.2" {{/jvm-okhttp4}} {{#threetenbp}} compile "org.threeten:threetenbp:1.4.0" {{/threetenbp}} - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache index 4b7d0599cb2..c8b2269da95 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache @@ -1,6 +1,6 @@ package {{packageName}}.infrastructure -typealias MultiValueMap = MutableMap> +{{#nonPublicApi}}internal {{/nonPublicApi}}typealias MultiValueMap = MutableMap> {{#nonPublicApi}}internal {{/nonPublicApi}}fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache index e7fcabf7ddf..ff7e68a98fc 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache @@ -71,11 +71,16 @@ import java.io.File } {{#jvm-okhttp3}} mediaType == JsonMediaType -> RequestBody.create( + {{#moshi}} MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) + {{/moshi}} + {{#gson}} + MediaType.parse(mediaType), Serializer.gson.toJson(content, T::class.java) + {{/gson}} ) {{/jvm-okhttp3}} {{#jvm-okhttp4}} - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( + mediaType == JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).toJson(content){{/moshi}}{{#gson}}Serializer.gson.toJson(content, T::class.java){{/gson}}.toRequestBody( mediaType.toMediaTypeOrNull() ) {{/jvm-okhttp4}} @@ -93,7 +98,7 @@ import java.io.File return null } return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, T::class.java){{/gson}} else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiInfrastructureResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiInfrastructureResponse.kt.mustache index 1970b34824a..09e6301cee5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiInfrastructureResponse.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiInfrastructureResponse.kt.mustache @@ -10,7 +10,7 @@ package {{packageName}}.infrastructure } {{#nonPublicApi}}internal {{/nonPublicApi}}class Success( - val data: T, + val data: T{{#nullableReturnType}}?{{/nullableReturnType}}, override val statusCode: Int = -1, override val headers: Map> = mapOf() ): ApiInfrastructureResponse(ResponseType.Success) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ByteArrayAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ByteArrayAdapter.kt.mustache index aacd100ea7a..9f56848226c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ByteArrayAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ByteArrayAdapter.kt.mustache @@ -1,12 +1,50 @@ package {{packageName}}.infrastructure +{{#moshi}} import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson +{{/moshi}} +{{#gson}} +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +{{/gson}} +{{#moshi}} {{#nonPublicApi}}internal {{/nonPublicApi}}class ByteArrayAdapter { @ToJson fun toJson(data: ByteArray): String = String(data) @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} +{{/moshi}} +{{#gson}} +{{#nonPublicApi}}internal {{/nonPublicApi}}class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} +{{/gson}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/DateAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/DateAdapter.kt.mustache new file mode 100644 index 00000000000..7e7e35b74bd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/DateAdapter.kt.mustache @@ -0,0 +1,37 @@ +package {{packageName}}.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +{{#nonPublicApi}}internal {{/nonPublicApi}}class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: Date?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): Date? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return formatter.parse(out.nextString()) + } + } + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateAdapter.kt.mustache index 84635bd2f12..152266a5964 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateAdapter.kt.mustache @@ -1,7 +1,16 @@ package {{packageName}}.infrastructure +{{#moshi}} import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson +{{/moshi}} +{{#gson}} +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +{{/gson}} {{^threetenbp}} import java.time.LocalDate import java.time.format.DateTimeFormatter @@ -11,6 +20,7 @@ import org.threeten.bp.LocalDate import org.threeten.bp.format.DateTimeFormatter {{/threetenbp}} +{{#moshi}} {{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateAdapter { @ToJson fun toJson(value: LocalDate): String { @@ -23,3 +33,31 @@ import org.threeten.bp.format.DateTimeFormatter } } +{{/moshi}} +{{#gson}} +{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} +{{/gson}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateTimeAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateTimeAdapter.kt.mustache index 48f40dbe7c0..0935b0053e5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateTimeAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateTimeAdapter.kt.mustache @@ -1,7 +1,16 @@ package {{packageName}}.infrastructure +{{#moshi}} import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson +{{/moshi}} +{{#gson}} +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +{{/gson}} {{^threetenbp}} import java.time.LocalDateTime import java.time.format.DateTimeFormatter @@ -11,6 +20,7 @@ import org.threeten.bp.LocalDateTime import org.threeten.bp.format.DateTimeFormatter {{/threetenbp}} +{{#moshi}} {{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateTimeAdapter { @ToJson fun toJson(value: LocalDateTime): String { @@ -23,3 +33,31 @@ import org.threeten.bp.format.DateTimeFormatter } } +{{/moshi}} +{{#gson}} +{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} +{{/gson}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Serializer.kt.mustache index 699a78f923f..df4c33c26d2 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Serializer.kt.mustache @@ -1,11 +1,27 @@ package {{packageName}}.infrastructure +{{#moshi}} import com.squareup.moshi.Moshi import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +{{/moshi}} +{{#gson}} +import com.google.gson.Gson +import com.google.gson.GsonBuilder +{{^threetenbp}} +import java.time.LocalDate +import java.time.LocalDateTime +{{/threetenbp}} +{{#threetenbp}} +import org.threeten.bp.LocalDate +import org.threeten.bp.LocalDateTime +{{/threetenbp}} +import java.util.UUID +{{/gson}} import java.util.Date {{#nonPublicApi}}internal {{/nonPublicApi}}object Serializer { +{{#moshi}} @JvmStatic val moshi: Moshi = Moshi.Builder() .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) @@ -15,4 +31,15 @@ import java.util.Date .add(ByteArrayAdapter()) .add(KotlinJsonAdapterFactory()) .build() +{{/moshi}} +{{#gson}} + @JvmStatic + val gson: Gson = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(UUID::class.java, UUIDAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + .create() +{{/gson}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/UUIDAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/UUIDAdapter.kt.mustache index a1ebc2cfced..ad442305b17 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/UUIDAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/UUIDAdapter.kt.mustache @@ -1,9 +1,19 @@ package {{packageName}}.infrastructure +{{#moshi}} import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson +{{/moshi}} +{{#gson}} +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +{{/gson}} import java.util.UUID +{{#moshi}} {{#nonPublicApi}}internal {{/nonPublicApi}}class UUIDAdapter { @ToJson fun toJson(uuid: UUID) = uuid.toString() @@ -11,3 +21,31 @@ import java.util.UUID @FromJson fun fromJson(s: String) = UUID.fromString(s) } +{{/moshi}} +{{#gson}} +{{#nonPublicApi}}internal {{/nonPublicApi}}class UUIDAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: UUID?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(value.toString()) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): UUID? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return UUID.fromString(out.nextString()) + } + } + } +} +{{/gson}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache new file mode 100644 index 00000000000..15ca438bffa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache @@ -0,0 +1,24 @@ +package {{package}}; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import java.util.Optional; +{{>generatedAnnotation}} + +@Controller +{{=<% %>=}} +@RequestMapping("\${openapi.<%title%>.base-path:<%>defaultBasePath%>}") +<%={{ }}=%> +{{#operations}} +class {{classname}}Controller( + @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: {{classname}}Delegate +) : {{classname}} { + private val delegate: {{classname}}Delegate + + init { + this.delegate = Optional.ofNullable(delegate).orElse(object : {{classname}}Delegate {}) + } + + override fun getDelegate(): {{classname}}Delegate = delegate +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache new file mode 100644 index 00000000000..8375e2f1ecb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache @@ -0,0 +1,42 @@ +package {{package}} + +{{#imports}}import {{import}} +{{/imports}} +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.core.io.Resource +{{#reactive}} +import org.springframework.web.server.ServerWebExchange +import reactor.core.publisher.Flux +import reactor.core.publisher.Mono +{{/reactive}} + +import java.util.Optional +{{#async}} +import java.util.concurrent.CompletableFuture +{{/async}} + +{{#operations}} +/** + * A delegate to be called by the {@link {{classname}}Controller}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +{{>generatedAnnotation}} +interface {{classname}}Delegate { + + fun getRequest(): Optional = Optional.empty() +{{#operation}} + + /** + * @see {{classname}}#{{operationId}} + */ + fun {{operationId}}({{#allParams}}{{paramName}}: {{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{{dataType}}}{{/isBodyParam}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{#hasMore}}, + {{/hasMore}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} { + {{>methodBody}} + } + +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index 84fbf253d93..4fab9201204 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -1,3 +1,8 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ package {{package}} {{#imports}}import {{import}} @@ -14,7 +19,7 @@ import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.stereotype.Controller + import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestPart import org.springframework.web.bind.annotation.RequestParam @@ -56,6 +61,10 @@ import kotlin.collections.Map <%={{ }}=%> {{#operations}} interface {{classname}} { +{{#isDelegate}} + + fun getDelegate(): {{classname}}Delegate = object: {{classname}}Delegate {} +{{/isDelegate}} {{#operation}} {{#swaggerAnnotations}} @@ -76,7 +85,12 @@ interface {{classname}} { consumes = [{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}],{{/hasConsumes}}{{/singleContentTypes}} method = [RequestMethod.{{httpMethod}}]) {{#reactive}}{{^isListContainer}}suspend {{/isListContainer}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}): ResponseEntity<{{>returnTypes}}> { + {{^isDelegate}} return {{>returnValue}} + {{/isDelegate}} + {{#isDelegate}} + return getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}); + {{/isDelegate}} } {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiUtil.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiUtil.mustache new file mode 100644 index 00000000000..4837075c136 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiUtil.mustache @@ -0,0 +1,23 @@ +package {{apiPackage}} + +{{^reactive}} +import org.springframework.web.context.request.NativeWebRequest + +import javax.servlet.http.HttpServletResponse +import java.io.IOException +{{/reactive}} + +object ApiUtil { +{{^reactive}} + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res.setCharacterEncoding("UTF-8") + res.addHeader("Content-Type", contentType) + res.getWriter().print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +{{/reactive}} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/generatedAnnotation.mustache new file mode 100644 index 00000000000..ad17a426e96 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/generatedAnnotation.mustache @@ -0,0 +1,3 @@ +{{^hideGenerationTimestamp}} +@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}") +{{/hideGenerationTimestamp}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/defaultBasePath.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/defaultBasePath.mustache new file mode 100644 index 00000000000..3c7185bd628 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/defaultBasePath.mustache @@ -0,0 +1 @@ +{{contextPath}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/methodBody.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/methodBody.mustache new file mode 100644 index 00000000000..69a9fd42d93 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/methodBody.mustache @@ -0,0 +1,23 @@ +{{#examples}} + {{#-first}} + {{#async}} +return CompletableFuture.supplyAsync(()-> { + {{/async}}getRequest().ifPresent { request -> +{{#async}} {{/async}} for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { + {{/-first}} +{{#async}} {{/async}}{{^async}} {{/async}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { +{{#async}} {{/async}}{{^async}} {{/async}} ApiUtil.setExampleResponse(request, "{{{contentType}}}", "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{example}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}") +{{#async}} {{/async}}{{^async}} {{/async}} break +{{#async}} {{/async}}{{^async}} {{/async}} } + {{#-last}} +{{#async}} {{/async}}{{^async}} {{/async}} } +{{#async}} {{/async}} } +{{#async}} {{/async}} return ResponseEntity({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}) + {{#async}} + }, Runnable::run) + {{/async}} + {{/-last}} +{{/examples}} +{{^examples}} +return {{#async}}CompletableFuture.completedFuture({{/async}}ResponseEntity({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}) +{{/examples}} diff --git a/modules/openapi-generator/src/main/resources/ocaml/readme.mustache b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache index 2ecff7daa88..9cd39793a8a 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/readme.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache @@ -24,7 +24,7 @@ OCaml 4.x Please run the following commands to build the package `{{{packageName}}}`: ```sh -opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix +opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix pin ocaml-migrate-parsetree 1.3.1 eval $(opam env) dune build ``` diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 790ec220461..3bf085e1904 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -629,11 +629,11 @@ class ApiClient(object): return data kwargs = {} - if klass.openapi_types is not None: + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): + if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 9677031a8c9..6e02b238da1 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -4,7 +4,6 @@ from __future__ import absolute_import -import copy import logging {{^asyncio}} import multiprocessing @@ -16,21 +15,7 @@ import six from six.moves import http_client as httplib -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls, **kwargs): - if cls._default is None: - cls._default = type.__call__(cls, **kwargs) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -44,7 +29,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """ def __init__(self, host="{{{basePath}}}", - api_key={}, api_key_prefix={}, + api_key=None, api_key_prefix=None, username="", password=""): """Constructor """ @@ -55,10 +40,14 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """Temp file folder for downloading files """ # Authentication Settings - self.api_key = api_key + self.api_key = {} + if api_key: + self.api_key = api_key """dict to store API key(s) """ - self.api_key_prefix = api_key_prefix + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index aec1ef37536..25ca4b5043f 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -346,18 +346,19 @@ class ApiClient(object): _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, _check_type) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - return thread + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache index 0a663ef944a..cf4a62a99eb 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache @@ -87,7 +87,11 @@ hash = {{^parent}}{}{{/parent}}{{#parent}}super{{/parent}} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache index f0d7c40a5bc..536d8f2926b 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache @@ -51,6 +51,17 @@ } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + {{#vars}} + {{#isNullable}} + :'{{{name}}}'{{#hasMore}},{{/hasMore}} + {{/isNullable}} + {{/vars}} + ]) + end + {{#anyOf}} {{#-first}} # List of class defined in anyOf (OpenAPI v3) diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index 054cd2deb25..ba110caee2c 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -8,7 +8,7 @@ {{!-- for enum schemas --}} {{#isEnum}} /// {{{description}}} -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum {{classname}} { {{#allowableValues}} {{#enumVars}} @@ -20,7 +20,7 @@ pub enum {{classname}} { {{!-- for schemas that have a discriminator --}} {{#discriminator}} -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "{{{vendorExtensions.tagName}}}")] pub enum {{classname}} { {{#vendorExtensions}} @@ -44,7 +44,7 @@ pub enum {{classname}} { {{!-- for non-enum schemas --}} {{^isEnum}} {{^discriminator}} -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct {{{classname}}} { {{#vars}} {{#description}} @@ -74,7 +74,7 @@ impl {{{classname}}} { {{#vars}} {{#isEnum}} /// {{{description}}} -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum {{enumName}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/scalaz/api.mustache b/modules/openapi-generator/src/main/resources/scalaz/api.mustache index 9eeba0a96ee..cddc6eb008f 100644 --- a/modules/openapi-generator/src/main/resources/scalaz/api.mustache +++ b/modules/openapi-generator/src/main/resources/scalaz/api.mustache @@ -21,6 +21,9 @@ import scalaz.concurrent.Task import HelperCodecs._ +{{#imports}}import {{import}} +{{/imports}} + {{#operations}} object {{classname}} { diff --git a/modules/openapi-generator/src/main/resources/scalaz/build.properties.mustache b/modules/openapi-generator/src/main/resources/scalaz/build.properties.mustache new file mode 100644 index 00000000000..cf19fd026fd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/scalaz/build.properties.mustache @@ -0,0 +1 @@ +sbt.version=0.13.15 \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/scalaz/model.mustache b/modules/openapi-generator/src/main/resources/scalaz/model.mustache index 9333e6bd569..d582ab10abc 100644 --- a/modules/openapi-generator/src/main/resources/scalaz/model.mustache +++ b/modules/openapi-generator/src/main/resources/scalaz/model.mustache @@ -7,6 +7,10 @@ import argonaut.DecodeJson._ import org.http4s.{EntityDecoder, EntityEncoder} import org.http4s.argonaut._ import org.joda.time.DateTime + +{{#imports}}import {{import}} +{{/imports}} + {{#models}} {{#model}} import {{classname}}._ diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 1ab70a7427c..28d21d1e299 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -30,11 +30,29 @@ import { {{classname}} } from '../{{filename}}'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; {{#withInterfaces}} -import { {{classname}}Interface } from './{{classFilename}}Interface'; +import { + {{classname}}Interface{{#useSingleRequestParameter}}{{#operations}}{{#operation}}{{#allParams.0}}, + {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams{{/allParams.0}}{{/operation}}{{/operations}}{{/useSingleRequestParameter}} +} from './{{classFilename}}Interface'; {{/withInterfaces}} {{#operations}} +{{^withInterfaces}} +{{#useSingleRequestParameter}} +{{#operation}} +{{#allParams.0}} +export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams { +{{#allParams}} + {{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#isNullable}} | null{{/isNullable}}; +{{/allParams}} +} + +{{/allParams.0}} +{{/operation}} +{{/useSingleRequestParameter}} +{{/withInterfaces}} + {{#description}} /** * {{&description}} @@ -108,11 +126,14 @@ export class {{classname}} { {{#summary}} * @summary {{&summary}} {{/summary}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}*/ + {{^useSingleRequestParameter}}{{#allParams}} + * @param {{paramName}} {{description}}{{/allParams}}{{/useSingleRequestParameter}} + {{#useSingleRequestParameter}}{{#allParams.0}} + * @param requestParameters + {{/allParams.0}}{{/useSingleRequestParameter}}*/ {{! if you change this method signature, also change the version below }} - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}{{#hasParams}}, {{/hasParams}}extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { - return this.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}extraHttpRequestParams) + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams{{/allParams.0}}{{/useSingleRequestParameter}}{{^useHttpClient}}{{#hasParams}}, {{/hasParams}}extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { + return this.{{nickname}}WithHttpInfo({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters, {{/allParams.0}}{{/useSingleRequestParameter}}extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -138,20 +159,34 @@ export class {{classname}} { {{#notes}} * {{notes}} {{/notes}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}{{#useHttpClient}}* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress.{{/useHttpClient}} + {{^useSingleRequestParameter}} + {{#allParams}} + * @param {{paramName}} {{description}} + {{/allParams}} + {{/useSingleRequestParameter}} + {{#useSingleRequestParameter}} + {{#allParams.0}} + * @param requestParameters + {{/allParams.0}} + {{/useSingleRequestParameter}} + {{#useHttpClient}} + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + {{/useHttpClient}} */ {{#useHttpClient}} - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe?: 'body', reportProgress?: boolean): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe?: 'response', reportProgress?: boolean): Observable>; - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe?: 'events', reportProgress?: boolean): Observable>; - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe: any = 'body', reportProgress: boolean = false ): Observable { + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'body', reportProgress?: boolean): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'response', reportProgress?: boolean): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'events', reportProgress?: boolean): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe: any = 'body', reportProgress: boolean = false ): Observable { {{/useHttpClient}} {{^useHttpClient}} - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: RequestOptionsArgs): Observable { + public {{nickname}}WithHttpInfo({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}extraHttpRequestParams?: RequestOptionsArgs): Observable { {{/useHttpClient}} {{#allParams}} +{{#useSingleRequestParameter}} + const {{paramName}} = requestParameters.{{paramName}}; +{{/useSingleRequestParameter}} {{#required}} if ({{paramName}} === null || {{paramName}} === undefined) { throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache index fb60c1a394f..9f2f19a8129 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache @@ -22,6 +22,19 @@ import { Configuration } from '../configurat {{#operations}} +{{#useSingleRequestParameter}} +{{#operation}} +{{#allParams.0}} +export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams { +{{#allParams}} + {{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#isNullable}} | null{{/isNullable}}; +{{/allParams}} +} + +{{/allParams.0}} +{{/operation}} +{{/useSingleRequestParameter}} + {{#description}} /** * {{&description}} @@ -34,11 +47,13 @@ export interface {{classname}}Interface { {{#operation}} /** - * {{summary}} - * {{notes}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}*/ - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>; + * {{summary}} + * {{notes}} + {{^useSingleRequestParameter}} + {{#allParams}}* @param {{paramName}} {{description}} + {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}* @param requestParameters + {{/allParams.0}}{{/useSingleRequestParameter}}*/ + {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>; {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache index 0db1d9a5a80..b08c8f24dc1 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache @@ -19,6 +19,6 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole return json as {{classname}}; } -export function {{classname}}ToJSON(value?: {{classname}}): any { +export function {{classname}}ToJSON(value?: {{classname}} | null): any { return value as any; } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache index 013bf40a47b..ca1837946ea 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache @@ -63,10 +63,10 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole {{#vars}} {{#isPrimitiveType}} {{#isDate}} - '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}new Date(json['{{baseName}}']), + '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}({{#isNullable}}json['{{baseName}}'] === null ? null : {{/isNullable}}new Date(json['{{baseName}}'])), {{/isDate}} {{#isDateTime}} - '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}new Date(json['{{baseName}}']), + '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}({{#isNullable}}json['{{baseName}}'] === null ? null : {{/isNullable}}new Date(json['{{baseName}}'])), {{/isDateTime}} {{^isDate}} {{^isDateTime}} @@ -76,10 +76,10 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isListContainer}} - '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}(json['{{baseName}}'] as Array).map({{#items}}{{datatype}}{{/items}}FromJSON), + '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}({{#isNullable}}json['{{baseName}}'] === null ? null : {{/isNullable}}(json['{{baseName}}'] as Array).map({{#items}}{{datatype}}{{/items}}FromJSON)), {{/isListContainer}} {{#isMapContainer}} - '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}mapValues(json['{{baseName}}'], {{#items}}{{datatype}}{{/items}}FromJSON), + '{{name}}': {{^required}}!exists(json, '{{baseName}}') ? undefined : {{/required}}({{#isNullable}}json['{{baseName}}'] === null ? null : {{/isNullable}}mapValues(json['{{baseName}}'], {{#items}}{{datatype}}{{/items}}FromJSON)), {{/isMapContainer}} {{^isListContainer}} {{^isMapContainer}} @@ -116,14 +116,14 @@ export function {{classname}}ToJSON(value?: {{classname}} | null): any { {{#vars}} {{^isReadOnly}} {{#isPrimitiveType}} - '{{baseName}}': {{#isDate}}{{^required}}value.{{name}} == null ? undefined : {{/required}}value.{{name}}.toISOString().substr(0,10){{/isDate}}{{#isDateTime}}{{^required}}value.{{name}} == null ? undefined : {{/required}}value.{{name}}.toISOString(){{/isDateTime}}{{^isDate}}{{^isDateTime}}value.{{name}}{{/isDateTime}}{{/isDate}}, + '{{baseName}}': {{#isDate}}{{^required}}value.{{name}} === undefined ? undefined : {{/required}}({{#isNullable}}value.{{name}} === null ? null : {{/isNullable}}value.{{name}}.toISOString().substr(0,10)){{/isDate}}{{#isDateTime}}{{^required}}value.{{name}} === undefined ? undefined : {{/required}}({{#isNullable}}value.{{name}} === null ? null : {{/isNullable}}value.{{name}}.toISOString()){{/isDateTime}}{{^isDate}}{{^isDateTime}}value.{{name}}{{/isDateTime}}{{/isDate}}, {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isListContainer}} - '{{baseName}}': {{^required}}value.{{name}} == null ? undefined : {{/required}}(value.{{name}} as Array).map({{#items}}{{datatype}}{{/items}}ToJSON), + '{{baseName}}': {{^required}}value.{{name}} === undefined ? undefined : {{/required}}({{#isNullable}}value.{{name}} === null ? null : {{/isNullable}}(value.{{name}} as Array).map({{#items}}{{datatype}}{{/items}}ToJSON)), {{/isListContainer}} {{#isMapContainer}} - '{{baseName}}': {{^required}}value.{{name}} == null ? undefined : {{/required}}mapValues(value.{{name}}, {{#items}}{{datatype}}{{/items}}ToJSON), + '{{baseName}}': {{^required}}value.{{name}} === undefined ? undefined : {{/required}}({{#isNullable}}value.{{name}} === null ? null : {{/isNullable}}mapValues(value.{{name}}, {{#items}}{{datatype}}{{/items}}ToJSON)), {{/isMapContainer}} {{^isListContainer}} {{^isMapContainer}} @@ -134,7 +134,7 @@ export function {{classname}}ToJSON(value?: {{classname}} | null): any { '{{baseName}}': value.{{name}}, {{/isFreeFormObject}} {{/isMapContainer}} - {{/isListContainer}} + {{/isListContainer}} {{/isPrimitiveType}} {{/isReadOnly}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache index 11e4f25fba4..2c957dbd204 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache @@ -3,6 +3,10 @@ import { {{#imports}} {{{.}}}, {{/imports}} + {{#oneOf}} + {{{.}}}FromJSONTyped, + {{{.}}}ToJSON, + {{/oneOf}} } from './'; {{/hasImports}} @@ -11,4 +15,49 @@ import { * {{{description}}}{{/description}} * @export */ -export type {{classname}} = {{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}}; \ No newline at end of file +export type {{classname}} = {{#discriminator}}{{#mappedModels}}{ {{discriminator.propertyName}}: '{{mappingName}}' } & {{modelName}}{{^-last}} | {{/-last}}{{/mappedModels}}{{/discriminator}}{{^discriminator}}{{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}}{{/discriminator}}; + +export function {{classname}}FromJSON(json: any): {{classname}} { + return {{classname}}FromJSONTyped(json, false); +} + +export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boolean): {{classname}} { + if ((json === undefined) || (json === null)) { + return json; + } +{{#discriminator}} + switch (json['{{discriminator.propertyName}}']) { +{{#discriminator.mappedModels}} + case '{{mappingName}}': + return {...{{modelName}}FromJSONTyped(json, true), {{discriminator.propertyName}}: '{{mappingName}}'}; +{{/discriminator.mappedModels}} + default: + throw new Error(`No variant of {{classname}} exists with '{{discriminator.propertyName}}=${json['{{discriminator.propertyName}}']}'`); + } +{{/discriminator}} +{{^discriminator}} + return { {{#oneOf}}...{{{.}}}FromJSONTyped(json, true){{^-last}}, {{/-last}}{{/oneOf}} }; +{{/discriminator}} +} + +export function {{classname}}ToJSON(value?: {{classname}} | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } +{{#discriminator}} + switch (value['{{discriminator.propertyName}}']) { +{{#discriminator.mappedModels}} + case '{{mappingName}}': + return {{modelName}}ToJSON(value); +{{/discriminator.mappedModels}} + default: + throw new Error(`No variant of {{classname}} exists with '{{discriminator.propertyName}}=${value['{{discriminator.propertyName}}']}'`); + } +{{/discriminator}} +{{^discriminator}} + return { {{#oneOf}}...{{{.}}}ToJSON(value){{^-last}}, {{/-last}}{{/oneOf}} }; +{{/discriminator}} +} diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache index 3c548d7b547..1528c0dcbb6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache @@ -15,7 +15,7 @@ import { {{#allParams.0}} export interface {{operationIdCamelCase}}Request { {{#allParams}} - {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}; + {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}; {{/allParams}} } diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache index 543ab776e4d..447c1de6e5a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache @@ -21,7 +21,7 @@ export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ * @type {{=<% %>=}}{<%&datatype%>}<%={{ }}=%> * @memberof {{classname}} */ - {{#isReadOnly}}readonly {{/isReadOnly}}{{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; + {{#isReadOnly}}readonly {{/isReadOnly}}{{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}; {{/vars}} }{{#hasEnums}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 8914a7edfdb..4221086015c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -1030,5 +1030,50 @@ public class DefaultCodegenTest { CodegenParameter parameter = codegenParameter("/set_should_explode"); assertTrue(parameter.isExplode); } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_Boolean_true() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, true); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertTrue(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_Boolean_false() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, false); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_true() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "true"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertTrue(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_false() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "false"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_blibb() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "blibb"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocSampleGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocSampleGeneratorTest.java index 930cab9ded2..d12d2b6f75a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocSampleGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocSampleGeneratorTest.java @@ -12,23 +12,25 @@ import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.AsciidocDocumentationCodegen; import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +/** several asciidoc content checks with sample openapi v3. */ public class AsciidocSampleGeneratorTest { - /** - * ensure api-docs.json includes sample and spec files into markup. - * @throws Exception generic exception - */ - @Test - public void testSampleAsciidocMarkupGenerationFromJsonWithSpecsAndSamples() throws Exception { + public String markupContent = null; + public String markupFileName = null; + + File specDir = new File("src/test/resources/3_0/asciidoc/specs/"); + File snippetDir = new File("src/test/resources/3_0/asciidoc/generated-snippets/"); + + @BeforeClass + public void beforeClassGenerateTestMarkup() throws Exception { File outputTempDirectory = Files.createTempDirectory("test-asciidoc-sample-generator.").toFile(); - File specDir = new File("src/test/resources/3_0/asciidoc/specs/"); - File snippetDir = new File("src/test/resources/3_0/asciidoc/generated-snippets/"); - - Assert.assertTrue(specDir.exists(), "test cancel, not specdDir found to use." + specDir.getPath()); + Assert.assertTrue(specDir.exists(), "test cancel, not specDir found to use." + specDir.getPath()); Assert.assertTrue(snippetDir.exists(), "test cancel, not snippedDir found to use." + snippetDir.getPath()); final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("asciidoc") @@ -40,46 +42,77 @@ public class AsciidocSampleGeneratorTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(configurator.toClientOptInput()).generate(); - boolean markupFileGenerated = false; - for (File file : files) { if (file.getName().equals("index.adoc")) { - markupFileGenerated = true; - String markupContent = FileUtils.readFileToString(file, StandardCharsets.UTF_8); - - // include correct values from cli. - Assert.assertTrue(markupContent.contains(":specDir: " + specDir.toString()), - "expected :specDir: in: " + markupContent.substring(0, 350)); - Assert.assertTrue(markupContent.contains(":snippetDir: " + snippetDir.toString()), - "expected :snippetDir: in: " + markupContent.substring(0, 350)); - - // include correct markup from separate directories, relative links - Assert.assertTrue(markupContent.contains("include::rest/project/GET/spec.adoc[]"), - "expected project spec.adoc to be included in " + file.getAbsolutePath()); - - Assert.assertTrue(markupContent.contains("include::rest/project/GET/implementation.adoc[]"), - "expected project implementation.adoc to be included in " + file.getAbsolutePath()); - - Assert.assertTrue(markupContent.contains("include::rest/project/GET/http-request.adoc[]"), - "expected project http-request.adoc to be included in " + file.getAbsolutePath()); - - Assert.assertTrue(markupContent.contains("include::rest/project/GET/http-response.adoc[]"), - "expected project http-response.adoc to be included in " + file.getAbsolutePath()); - - Assert.assertTrue(markupContent.contains("link:rest/project/GET/GET.json["), - "expected link: not found in file: " + file.getAbsoluteFile()); - - // extract correct value from json - Assert.assertTrue(markupContent.contains("= time@work rest api"), - "missing main header for api spec from json: " + markupContent.substring(0, 100)); + this.markupFileName = file.getAbsoluteFile().toString(); + this.markupContent = FileUtils.readFileToString(file, StandardCharsets.UTF_8); } - Files.deleteIfExists(Paths.get(file.getAbsolutePath())); } + } - Assert.assertTrue(markupFileGenerated, "index.adoc is not generated!"); + @AfterClass + public void afterClassCleanUpTestMarkup() throws Exception { + if (this.markupFileName != null) { + Files.deleteIfExists(Paths.get(this.markupFileName)); + } + } - Files.deleteIfExists(Paths.get(outputTempDirectory.getAbsolutePath(), ".openapi-generator")); - Files.deleteIfExists(Paths.get(outputTempDirectory.getAbsolutePath())); + @Test + public void testMarkupExistence() { + Assert.assertNotNull(this.markupContent, "asciidoc content index.adoc not created."); + } + + /** + * ensure api-docs.json includes sample and spec files directory as attributes. + */ + @Test + public void testSampleAsciidocMarkupGenerationFromJsonWithAttributes() throws Exception { + Assert.assertTrue(markupContent.contains(":specDir: " + specDir.toString()), + "expected :specDir: in: " + markupContent.substring(0, 350)); + Assert.assertTrue(markupContent.contains(":snippetDir: " + snippetDir.toString()), + "expected :snippetDir: in: " + markupContent.substring(0, 350)); + } + + /** + * ensure api-docs.json includes sample and spec files into markup. + */ + @Test + public void testSampleAsciidocMarkupGenerationFromJsonWithIncludes() throws Exception { + + // include correct markup from separate directories, relative links + Assert.assertTrue(markupContent.contains("include::rest/project/GET/spec.adoc["), + "expected project spec.adoc to be included in " + markupFileName); + + Assert.assertTrue(markupContent.contains("include::rest/project/GET/implementation.adoc["), + "expected project implementation.adoc to be included in " + markupFileName); + + Assert.assertTrue(markupContent.contains("include::rest/project/GET/http-request.adoc["), + "expected project http-request.adoc to be included in " + markupFileName); + + Assert.assertTrue(markupContent.contains("include::rest/project/GET/http-response.adoc["), + "expected project http-response.adoc to be included in " + markupFileName); + + Assert.assertTrue(markupContent.contains("link:rest/project/GET/GET.json["), + "expected link: not found in file: " + markupFileName); + } + + /** + * markup doc header content. + */ + @Test + public void testSampleAsciidocMarkupGenerationFromJsonWithContent() throws Exception { + Assert.assertTrue(markupContent.contains("= time@work rest api"), + "missing main header for api spec from json: " + markupContent.substring(0, 100)); + + } + + /** + * fix: parameter name unchanged. + */ + @Test + public void testSampleAsciidocMarkupGenerationParameterNameUnchanged() throws Exception { + Assert.assertTrue(markupContent.contains("from-iso-date-string"), + "keep parameter name from-iso-date-string unchanged."); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/IncludeMarkupFilterTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/IncludeMarkupFilterTest.java index 7c178b49550..0419969ef4f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/IncludeMarkupFilterTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/IncludeMarkupFilterTest.java @@ -26,7 +26,7 @@ public class IncludeMarkupFilterTest extends LambdaTest { final Map ctx = context("specinclude", generator.new IncludeMarkupLambda("DOES_NOT_EXIST")); final String result = execute("{{#specinclude}}not.an.existing.file.adoc{{/specinclude}}", ctx); - Assert.assertTrue(result.contains("// markup not found, no include ::not.an.existing.file.adoc[]"), + Assert.assertTrue(result.contains("// markup not found, no include ::not.an.existing.file.adoc["), "unexpected filtered " + result); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java index 50b27a74806..349df52d7ca 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java @@ -17,6 +17,14 @@ package org.openapitools.codegen.dart; +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.languages.DartClientCodegen; import org.testng.Assert; @@ -53,4 +61,26 @@ public class DartClientCodegenTest { Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); } + @Test + public void testKeywords() throws Exception { + final DartClientCodegen codegen = new DartClientCodegen(); + + List reservedWordsList = new ArrayList(); + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), Charset.forName("UTF-8"))); + while(reader.ready()) { reservedWordsList.add(reader.readLine()); } + reader.close(); + } catch (Exception e) { + String errorString = String.format(Locale.ROOT, "Error reading dart keywords: %s", e); + Assert.fail(errorString, e); + } + + Assert.assertEquals(reservedWordsList.size() > 20, true); + Assert.assertEquals(codegen.reservedWords().size() == reservedWordsList.size(), true); + for(String keyword : reservedWordsList) { + // reserved words are stored in lowercase + Assert.assertEquals(codegen.reservedWords().contains(keyword.toLowerCase(Locale.ROOT)), true, String.format(Locale.ROOT, "%s, part of %s, was not found in %s", keyword, reservedWordsList, codegen.reservedWords().toString())); + } + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index 55cb8025f21..73ee84e9265 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -303,6 +303,7 @@ public class AbstractJavaCodegenTest { @Test(description = "tests if default version is used when neither OpenAPI version nor artifactVersion additional property has been provided") public void defaultVersionTest() { final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setArtifactVersion(null); OpenAPI api = TestUtils.createOpenAPI(); api.getInfo().setVersion(null); @@ -340,6 +341,55 @@ public class AbstractJavaCodegenTest { Assert.assertEquals(codegen.getArtifactVersion(), "2.0-SNAPSHOT"); } + @Test(description = "tests if setting an artifact version programmatically persists to additional properties, when openapi version is null") + public void allowsProgrammaticallySettingArtifactVersionWithNullOpenApiVersion() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final String version = "9.8.7-rc1"; + codegen.setArtifactVersion(version); + + OpenAPI api = TestUtils.createOpenAPI(); + api.getInfo().setVersion(null); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getArtifactVersion(), version); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), version); + } + + @Test(description = "tests if setting an artifact version programmatically persists to additional properties, even when openapi version is specified") + public void allowsProgrammaticallySettingArtifactVersionWithSpecifiedOpenApiVersion() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final String version = "9.8.7-rc1"; + codegen.setArtifactVersion(version); + + OpenAPI api = TestUtils.createOpenAPI(); + api.getInfo().setVersion("1.2.3-SNAPSHOT"); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getArtifactVersion(), version); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), version); + } + + @Test(description = "tests if a null in addition properties artifactVersion results in default version") + public void usesDefaultVersionWhenAdditionalPropertiesVersionIsNull() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final String version = "1.0.0"; + + OpenAPI api = TestUtils.createOpenAPI(); + api.getInfo().setVersion(null); + codegen.setArtifactVersion(null); + codegen.additionalProperties().put(CodegenConstants.ARTIFACT_VERSION, null); + + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getArtifactVersion(), version); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), version); + } + + + @Test(description = "tests if default version with snapshot is used when setArtifactVersion is used") public void snapshotVersionAlreadySnapshotTest() { final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); @@ -372,6 +422,60 @@ public class AbstractJavaCodegenTest { Assert.assertEquals(defaultValue, "Object"); } + @Test + public void processOptsBooleanTrueFromString() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); + codegen.preprocessOpenAPI(openAPI); + Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); + } + + @Test + public void processOptsBooleanTrueFromBoolean() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, true); + codegen.preprocessOpenAPI(openAPI); + Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); + } + + @Test + public void processOptsBooleanFalseFromString() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "false"); + codegen.preprocessOpenAPI(openAPI); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); + } + + @Test + public void processOptsBooleanFalseFromBoolean() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, false); + codegen.preprocessOpenAPI(openAPI); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); + } + + @Test + public void processOptsBooleanFalseFromGarbage() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "blibb"); + codegen.preprocessOpenAPI(openAPI); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); + } + + @Test + public void processOptsBooleanFalseFromNumeric() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, 42L); + codegen.preprocessOpenAPI(openAPI); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); + } + private static Schema createObjectSchemaWithMinItems() { return new ObjectSchema() .addProperties("id", new IntegerSchema().format("int32")) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java index 3b8d691fac9..c7bb618500b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java @@ -22,9 +22,13 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Discriminator; +import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.JavaClientCodegen; import org.testng.Assert; @@ -78,4 +82,102 @@ public class JavaInheritanceTest { Assert.assertEquals(cm.parent, "Base"); Assert.assertEquals(cm.imports, Sets.newHashSet("Base")); } + + @Test(description = "composed model has the required attributes on the child") + public void javaInheritanceWithRequiredAttributesOnAllOfObject() { + Schema parent = new ObjectSchema() + .addProperties("a", new StringSchema()) + .addProperties("b", new StringSchema()) + .addRequiredItem("a") + .name("Parent"); + Schema child = new ComposedSchema() + .addAllOfItem(new Schema().$ref("Parent")) + .addAllOfItem(new ObjectSchema() + .addProperties("c", new StringSchema()) + .addProperties("d", new StringSchema()) + .addRequiredItem("a") + .addRequiredItem("c")) + .name("Child"); + OpenAPI openAPI = TestUtils.createOpenAPI(); + openAPI.getComponents().addSchemas(parent.getName(), parent); + openAPI.getComponents().addSchemas(child.getName(), child); + + final DefaultCodegen codegen = new JavaClientCodegen(); + codegen.setOpenAPI(openAPI); + + final CodegenModel pm = codegen + .fromModel("Parent", parent); + final CodegenProperty propertyPA = pm.allVars.get(0); + Assert.assertEquals(propertyPA.name, "a"); + Assert.assertTrue(propertyPA.required); + final CodegenProperty propertyPB = pm.allVars.get(1); + Assert.assertEquals(propertyPB.name, "b"); + Assert.assertFalse(propertyPB.required); + Assert.assertEquals(pm.requiredVars.size() + pm.optionalVars.size(), pm.allVars.size()); + + final CodegenModel cm = codegen + .fromModel("Child", child); + final CodegenProperty propertyCA = cm.allVars.get(0); + Assert.assertEquals(propertyCA.name, "a"); + Assert.assertTrue(propertyCA.required); + final CodegenProperty propertyCB = cm.allVars.get(1); + Assert.assertEquals(propertyCB.name, "b"); + Assert.assertFalse(propertyCB.required); + final CodegenProperty propertyCC = cm.allVars.get(2); + Assert.assertEquals(propertyCC.name, "c"); + Assert.assertTrue(propertyCC.required); + final CodegenProperty propertyCD = cm.allVars.get(3); + Assert.assertEquals(propertyCD.name, "d"); + Assert.assertFalse(propertyCD.required); + Assert.assertEquals(cm.requiredVars.size() + cm.optionalVars.size(), cm.allVars.size()); + } + + @Test(description = "composed model has the required attributes for both parent & child") + public void javaInheritanceWithRequiredAttributesOnComposedObject() { + Schema parent = new ObjectSchema() + .addProperties("a", new StringSchema()) + .addProperties("b", new StringSchema()) + .addRequiredItem("a") + .name("Parent"); + Schema child = new ComposedSchema() + .addAllOfItem(new Schema().$ref("Parent")) + .addAllOfItem(new ObjectSchema() + .addProperties("c", new StringSchema()) + .addProperties("d", new StringSchema())) + .name("Child") + .addRequiredItem("a") + .addRequiredItem("c"); + OpenAPI openAPI = TestUtils.createOpenAPI(); + openAPI.getComponents().addSchemas(parent.getName(), parent); + openAPI.getComponents().addSchemas(child.getName(), child); + + final DefaultCodegen codegen = new JavaClientCodegen(); + codegen.setOpenAPI(openAPI); + + final CodegenModel pm = codegen + .fromModel("Parent", parent); + final CodegenProperty propertyPA = pm.allVars.get(0); + Assert.assertEquals(propertyPA.name, "a"); + Assert.assertTrue(propertyPA.required); + final CodegenProperty propertyPB = pm.allVars.get(1); + Assert.assertEquals(propertyPB.name, "b"); + Assert.assertFalse(propertyPB.required); + Assert.assertEquals(pm.requiredVars.size() + pm.optionalVars.size(), pm.allVars.size()); + + final CodegenModel cm = codegen + .fromModel("Child", child); + final CodegenProperty propertyCA = cm.allVars.get(0); + Assert.assertEquals(propertyCA.name, "a"); + Assert.assertTrue(propertyCA.required); + final CodegenProperty propertyCB = cm.allVars.get(1); + Assert.assertEquals(propertyCB.name, "b"); + Assert.assertFalse(propertyCB.required); + final CodegenProperty propertyCC = cm.allVars.get(2); + Assert.assertEquals(propertyCC.name, "c"); + Assert.assertTrue(propertyCC.required); + final CodegenProperty propertyCD = cm.allVars.get(3); + Assert.assertEquals(propertyCD.name, "d"); + Assert.assertFalse(propertyCD.required); + Assert.assertEquals(cm.requiredVars.size() + cm.optionalVars.size(), cm.allVars.size()); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java index ff23d307d90..90c8acff528 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java @@ -1,5 +1,6 @@ package org.openapitools.codegen.kotlin; +import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.languages.AbstractKotlinCodegen; import org.testng.Assert; @@ -53,7 +54,7 @@ public class AbstractKotlinCodegenTest { } @Test - public void toEnumValue(){ + public void toEnumValue() { assertEquals(codegen.toEnumValue("1", "kotlin.Int"), "1"); assertEquals(codegen.toEnumValue("1", "kotlin.Double"), "1.0"); assertEquals(codegen.toEnumValue("1.3", "kotlin.Double"), "1.3"); @@ -81,14 +82,14 @@ public class AbstractKotlinCodegenTest { } @Test - public void isDataTypeString(){ + public void isDataTypeString() { assertFalse(codegen.isDataTypeString("kotlin.Int")); assertTrue(codegen.isDataTypeString("kotlin.String")); assertTrue(codegen.isDataTypeString("String")); } @Test - public void toModelNameShouldUseProvidedMapping() { + public void toModelNameShouldUseProvidedMapping() { codegen.importMapping().put("json_myclass", "com.test.MyClass"); assertEquals("com.test.MyClass", codegen.toModelName("json_myclass")); } @@ -155,5 +156,45 @@ public class AbstractKotlinCodegenTest { Assert.assertEquals(codegen.apiTestFileFolder(), "/User/open/api/tools/test/folder/org/openapitools/codegen/api".replace('/', File.separatorChar)); } + @Test + public void processOptsBooleanTrueFromString() { + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, "true"); + codegen.processOpts(); + Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SERIALIZABLE_MODEL)); + } + @Test + public void processOptsBooleanTrueFromBoolean() { + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, true); + codegen.processOpts(); + Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SERIALIZABLE_MODEL)); + } + + @Test + public void processOptsBooleanFalseFromString() { + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, "false"); + codegen.processOpts(); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SERIALIZABLE_MODEL)); + } + + @Test + public void processOptsBooleanFalseFromBoolean() { + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, false); + codegen.processOpts(); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SERIALIZABLE_MODEL)); + } + + @Test + public void processOptsBooleanFalseFromGarbage() { + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, "blibb"); + codegen.processOpts(); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SERIALIZABLE_MODEL)); + } + + @Test + public void processOptsBooleanFalseFromNumeric() { + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, 42L); + codegen.processOpts(); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SERIALIZABLE_MODEL)); + } } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index c830cd29b96..fcc01e4908e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -121,7 +121,7 @@ public class KotlinSpringServerCodegenTest { } @Test - public void testSettingInvokerPackageToBasePackage() throws Exception { + public void testSettingInvokerPackageToBasePackage() { final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.bbbb.invoker"); codegen.processOpts(); @@ -129,4 +129,23 @@ public class KotlinSpringServerCodegenTest { Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.bbbb.invoker"); Assert.assertEquals(codegen.getBasePackage(), "xyz.yyyyy.bbbb.invoker"); } + + @Test + public void testDelegatePattern() { + final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.additionalProperties().put(KotlinSpringServerCodegen.DELEGATE_PATTERN, true); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.DELEGATE_PATTERN), true); + Assert.assertEquals(codegen.additionalProperties().get("isDelegate"), "true"); + Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.SWAGGER_ANNOTATIONS), false); + Assert.assertTrue(codegen.getSwaggerAnnotations()); + + Assert.assertEquals(codegen.apiTemplateFiles().get("apiController.mustache"), "Controller.kt"); + Assert.assertEquals(codegen.apiTemplateFiles().get("apiDelegate.mustache"), "Delegate.kt"); + Assert.assertEquals(codegen.apiTemplateFiles().get("apiInterface.mustache"), ".kt"); + Assert.assertEquals(codegen.apiTemplateFiles().get("apiInterface.mustache"), ".kt"); + + Assert.assertTrue(codegen.supportingFiles().stream().anyMatch(supportingFile -> supportingFile.templateFile.equals("apiUtil.mustache"))); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index b18d05bdace..1797eae8aeb 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -59,6 +59,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .put(TypeScriptAngularClientCodegen.NPM_VERSION, NMP_VERSION) .put(TypeScriptAngularClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString()) + .put(TypeScriptAngularClientCodegen.USE_SINGLE_REQUEST_PARAMETER, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.PROVIDED_IN_ROOT, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.TAGGED_UNIONS, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/SplitStringLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/SplitStringLambdaTest.java new file mode 100644 index 00000000000..0224a1e695c --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/SplitStringLambdaTest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * 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.codegen.templating.mustache; + +import static org.mockito.Mockito.when; +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.samskivert.mustache.Template.Fragment; + +public class SplitStringLambdaTest { + private static final String INPUT_STRING = "1112223334"; + + private static final Map EXPECTED_OUTPUTS; + static { + EXPECTED_OUTPUTS = new HashMap<>(); + EXPECTED_OUTPUTS.put(2, + String.format( + Locale.ROOT, + "new StringBuilder(%d).append(\"11\").append(\"12\").append(\"22\").append(\"33\").append(\"34\").toString()", + INPUT_STRING.length())); + EXPECTED_OUTPUTS.put(3, + String.format( + Locale.ROOT, + "new StringBuilder(%d).append(\"111\").append(\"222\").append(\"333\").append(\"4\").toString()", + INPUT_STRING.length())); + } + + private static final String INPUT_QUOTED_STRING = "1\\\"11\\\"2223\\\"334"; + private static final String INPUT_QUOTED_OUTPUT = String.format( + Locale.ROOT, + "new StringBuilder(%d).append(\"1\\\"\").append(\"11\").append(\"\\\"2\").append(\"223\").append(\"\\\"3\").append(\"34\").toString()", + INPUT_QUOTED_STRING.length()); + + @Mock + private Fragment fragment; + + @BeforeMethod + public void init() { + MockitoAnnotations.initMocks(this); + } + + @AfterMethod + public void reset() { + Mockito.reset(fragment); + } + + private void testString(String input, int maxLength, String expected) throws IOException { + when(fragment.execute()).thenReturn(input); + + StringWriter output = new StringWriter(); + new SplitStringLambda(maxLength).execute(fragment, output); + assertEquals(output.toString(), expected); + } + + @Test + public void testSplitGroupsOf2() throws IOException { + int maxLength = 2; + testString(INPUT_STRING, maxLength, EXPECTED_OUTPUTS.get(maxLength)); + } + + @Test + public void testSplitGroupsOf3() throws IOException { + int maxLength = 3; + testString(INPUT_STRING, maxLength, EXPECTED_OUTPUTS.get(maxLength)); + } + + @Test + public void testSplitQuotedString() throws IOException { + int maxLength = 3; + testString(INPUT_QUOTED_STRING, maxLength, INPUT_QUOTED_OUTPUT); + } + + @Test + public void testShortString() throws IOException { + testString(INPUT_STRING, INPUT_STRING.length(), String.format(Locale.ROOT, "\"%s\"", INPUT_STRING)); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java new file mode 100644 index 00000000000..556bde9e105 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * 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.codegen.templating.mustache; + +import static org.mockito.Mockito.when; +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.io.StringWriter; + +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.samskivert.mustache.Template.Fragment; + +public class TrimWhitespaceLambdaTest { + + @Mock + private Fragment fragment; + + @BeforeMethod + public void init() { + MockitoAnnotations.initMocks(this); + } + + @AfterMethod + public void reset() { + Mockito.reset(fragment); + } + + @Test + public void testTrimWhitespace() throws IOException { + when(fragment.execute()).thenReturn("\t a b\t\tc \t"); + + StringWriter output = new StringWriter(); + new TrimWhitespaceLambda().execute(fragment, output); + assertEquals(output.toString(), " a b c "); + } + +} diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/api-docs.json b/modules/openapi-generator/src/test/resources/3_0/asciidoc/api-docs.json index 9a19658cc2c..4f1c22adf5d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/asciidoc/api-docs.json +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/api-docs.json @@ -1 +1,1416 @@ -{"openapi":"3.0.1","info":{"title":"time@work rest api","description":"internal rest api, used by time@work angular client","contact":{"name":"man@home","url":"https://gitlab.com/spare-time-demos/timeatwork","email":"man.at.home@do-not-use-this-mail.com"},"license":{"name":"Apache 2.0","url":"http://foo.bar"},"version":"0.1"},"externalDocs":{"description":"specs","url":"https://gitlab.com/spare-time-demos/timeatwork/tree/master/docs/src/main/docs/features"},"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"tags":[{"name":"ui-admin","description":"ui: admin and team lead api calls"},{"name":"ui-user","description":"ui: user api calls"},{"name":"admin","description":"admin api, internal use"},{"name":"graphql","description":"external graphql api (spike only)"}],"paths":{"/rest/admin/job/usersync":{"get":{"tags":["admin"],"summary":"start background job: usersync","operationId":"startuserSync","responses":{"200":{"description":"default response","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/rest/project":{"get":{"tags":["ui-admin"],"summary":"retrieving all visible projects for current user.","operationId":"getProjects","responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"post":{"tags":["ui-admin"],"summary":"create a new project.","operationId":"createProject","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}}}}},"/rest/project/{projectId}":{"get":{"tags":["ui-admin"],"summary":"retrieving a specific visible projects for current user.","operationId":"getProject","parameters":[{"name":"projectId","in":"path","description":"unique project id to find","required":true,"schema":{"type":"integer","format":"int64"},"example":"0185"}],"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}}}},"put":{"tags":["ui-admin"],"summary":"change an existing project.","operationId":"changeProject","parameters":[{"name":"projectId","in":"path","description":"unique project id to change","required":true,"schema":{"type":"integer","format":"int64"},"example":"0815"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}}}}},"/rest/project/{projectId}/task":{"get":{"tags":["ui-admin"],"summary":"retrieving tasks for a specific project.","operationId":"getProjectTasks","parameters":[{"name":"projectId","in":"path","description":"project id to find tasks for","required":true,"schema":{"type":"integer","format":"int64"},"example":"0815"}],"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}}}}},"post":{"tags":["ui-admin"],"summary":"create a new task for an existing project","operationId":"createTaskForProject","parameters":[{"name":"projectId","in":"path","description":"project id for task to change","required":true,"schema":{"type":"integer","format":"int64"},"example":"0815"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"responses":{"200":{"description":"task created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"404":{"description":"project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseStatusException"}}}}}}},"/rest/task/{taskId}":{"get":{"tags":["ui-admin"],"summary":"retrieving a specific task.","operationId":"getTask","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"default response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Task"}}}}}},"put":{"tags":["ui-admin"],"summary":"change an existing task.","operationId":"changeTask","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}}}},"delete":{"tags":["ui-admin"],"summary":"delete an existing task.","operationId":"deleteTask","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"default response","content":{"*/*":{"schema":{"type":"integer","format":"int64"}}}}}}},"/rest/task/{taskId}/assignment":{"get":{"tags":["ui-admin"],"summary":"retrieving team member assignments for a specific task.","operationId":"getTaskAssignments","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"default response","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TaskAssignment"}}}}}}},"post":{"tags":["ui-admin"],"summary":"add a new assignment to an existing task.","operationId":"createAssignment","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskAssignment"}}}},"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskAssignment"}}}}}}},"/rest/task/{taskId}/assignment/{id}":{"put":{"tags":["ui-admin"],"summary":"change from/until of given assignment","operationId":"changeAssignment","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskAssignment"}}}},"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskAssignment"}}}}}}},"/rest/task/{taskId}/assignment/{assignmentId}":{"delete":{"tags":["ui-admin"],"summary":"delete an existing assignment from task.","operationId":"deleteAssignment","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"assignmentId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"default response","content":{"*/*":{"schema":{"type":"integer","format":"int64"}}}}}}},"/rest/teammember":{"get":{"tags":["ui-admin","ui-user"],"summary":"retrieving all known users.","operationId":"getTeamMembers","responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamMember"}}}}}}}},"/rest/workweek/{fromIsoDateString}":{"get":{"tags":["ui-user"],"summary":"retrieving work week for given week, date format: /rest/workweek/YYYY-MM-DD.","operationId":"getWorkWeek","parameters":[{"name":"fromIsoDateString","in":"path","description":"date, start of week, format YYYY-MM-DD","required":true,"schema":{"type":"string"},"example":"2019-03-11"}],"responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkWeek"}}}}}},"put":{"tags":["ui-user"],"summary":"update work done for given week","operationId":"updateWorkWeek","parameters":[{"name":"fromIsoDateString","in":"path","description":"date, start of week, format YYYY-MM-DD","required":true,"schema":{"type":"string"},"example":"2019-03-11"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkWeek"}}}},"responses":{"200":{"description":"default response"}}}},"/graphql":{"get":{"operationId":"graphqlGET","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string"}},{"name":"operationName","in":"query","required":false,"schema":{"type":"string"}},{"name":"variables","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"default response","content":{"*/*":{"schema":{"type":"object"}}}}}},"post":{"operationId":"graphqlPOST","requestBody":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/GraphQLRequestBody"}}}},"responses":{"200":{"description":"default response","content":{"*/*":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"Project":{"required":["active","name"],"type":"object","properties":{"id":{"type":"integer","description":"unique project id.","format":"int64","example":815},"name":{"maxLength":100,"minLength":1,"type":"string","description":"unique descriptive name","example":"my unique project name"},"active":{"type":"boolean","description":"is project active for administration by project lead.","example":true},"projectLeads":{"type":"array","description":"project leads (administrator)","items":{"$ref":"#/components/schemas/TeamMember"}}},"description":"tracked project."},"TeamMember":{"required":["name","userId"],"type":"object","properties":{"id":{"type":"integer","description":"unique internal member id","format":"int64","example":4712},"name":{"maxLength":100,"type":"string","description":"unique descriptive name","example":"Tom Teammember"},"userId":{"maxLength":100,"type":"string","description":"unique descriptive name","example":"tlead1"}},"description":"a team member, could be project lead or an member with assigned tasks."},"Task":{"required":["name","project","state"],"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"maxLength":100,"minLength":1,"type":"string","description":"unique descriptive name","example":"first task: do something"},"state":{"type":"string","enum":["planned","active","done"]},"project":{"$ref":"#/components/schemas/Project"}},"description":"a project task to be worked on."},"ResponseStatusException":{"type":"object","properties":{"mostSpecificCause":{"type":"object","properties":{"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"message":{"type":"string"},"suppressed":{"type":"array","items":{"type":"object","properties":{"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"message":{"type":"string"},"localizedMessage":{"type":"string"}}}},"localizedMessage":{"type":"string"}}},"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"status":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]},"reason":{"type":"string"},"message":{"type":"string"},"rootCause":{"type":"object","properties":{"cause":{"type":"object","properties":{"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"message":{"type":"string"},"suppressed":{"type":"array","items":{"type":"object","properties":{"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"message":{"type":"string"},"localizedMessage":{"type":"string"}}}},"localizedMessage":{"type":"string"}}},"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"message":{"type":"string"},"suppressed":{"type":"array","items":{"type":"object","properties":{"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"message":{"type":"string"},"localizedMessage":{"type":"string"}}}},"localizedMessage":{"type":"string"}}},"suppressed":{"type":"array","items":{"type":"object","properties":{"stackTrace":{"type":"array","items":{"type":"object","properties":{"classLoaderName":{"type":"string"},"moduleName":{"type":"string"},"moduleVersion":{"type":"string"},"methodName":{"type":"string"},"fileName":{"type":"string"},"lineNumber":{"type":"integer","format":"int32"},"className":{"type":"string"},"nativeMethod":{"type":"boolean"}}}},"message":{"type":"string"},"localizedMessage":{"type":"string"}}}},"localizedMessage":{"type":"string"}}},"TaskAssignment":{"required":["from","teamMember"],"type":"object","properties":{"id":{"type":"integer","description":"internal unique assignment id","format":"int64","example":-1},"teamMember":{"$ref":"#/components/schemas/TeamMember"},"from":{"type":"string","description":"assignment start date","format":"date"},"until":{"type":"string","description":"optional assignment end date","format":"date"}},"description":"planned assignment of a team member to a given project task."},"TaskWeek":{"type":"object","properties":{"taskId":{"type":"integer","format":"int64"},"taskName":{"type":"string"},"workHours":{"type":"array","items":{"$ref":"#/components/schemas/WorkHoursAssigned"}}},"description":"one week of working hours for a given task."},"WorkHoursAssigned":{"type":"object","properties":{"workHours":{"type":"integer","format":"int64"},"readOnly":{"type":"boolean"}}},"WorkWeek":{"type":"object","properties":{"from":{"type":"string","format":"date"},"until":{"type":"string","format":"date"},"taskWeeks":{"type":"array","items":{"$ref":"#/components/schemas/TaskWeek"}}},"description":"week, holds all work and working assignments."},"GraphQLRequestBody":{"type":"object","properties":{"query":{"type":"string"},"operationName":{"type":"string"},"variables":{"type":"object","additionalProperties":{"type":"object"}}}}},"securitySchemes":{"APIKEY_IN_HEADER":{"type":"apiKey","description":"authentication with APIKEY http header not yet implemented","name":"APIKEY","in":"header"}}}} \ No newline at end of file +{ + "openapi": "3.0.1", + "info": { + "title": "time@work rest api", + "description": "internal rest api, used by time@work angular client", + "contact": { + "name": "man@home", + "url": "https://gitlab.com/spare-time-demos/timeatwork", + "email": "man.at.home@do-not-use-this-mail.com" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "version": "0.1" + }, + "externalDocs": { + "description": "specs", + "url": "https://gitlab.com/spare-time-demos/timeatwork/tree/master/docs/src/main/docs/features" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "ui-admin", + "description": "ui: admin and team lead api calls" + }, + { + "name": "ui-user", + "description": "ui: user api calls" + }, + { + "name": "security", + "description": "login" + }, + { + "name": "admin", + "description": "admin api, internal use" + } + ], + "paths": { + "/rest/admin/info": { + "get": { + "tags": [ + "admin" + ], + "summary": "(dummy) application info endpoint.", + "operationId": "info", + "responses": { + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/rest/admin/job/usersync": { + "get": { + "tags": [ + "admin" + ], + "summary": "start background job: usersync", + "operationId": "startuserSync", + "responses": { + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/authentication": { + "post": { + "tags": [ + "security" + ], + "summary": "login with username and password, getting an jwt token on successful.", + "operationId": "login", + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/AuthenticationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + } + } + } + }, + "/rest/project/": { + "get": { + "tags": [ + "ui-admin" + ], + "summary": "retrieving all visible projects for current user.", + "operationId": "getProjects", + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CProject" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "ui-admin" + ], + "summary": "create a new project.", + "operationId": "createProject", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CProject" + } + } + } + }, + "responses": { + "201": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CProject" + } + } + } + } + } + } + }, + "/rest/project/{projectId}": { + "get": { + "tags": [ + "ui-admin" + ], + "summary": "retrieving a specific visible projects for current user.", + "operationId": "getProject", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "unique project id to find", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "example": "0185" + } + ], + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CProject" + } + } + } + } + } + }, + "put": { + "tags": [ + "ui-admin" + ], + "summary": "change an existing project.", + "operationId": "changeProject", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "unique project id to change", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "example": "0815" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CProject" + } + } + } + }, + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CProject" + } + } + } + } + } + } + }, + "/rest/project/{projectId}/task": { + "get": { + "tags": [ + "ui-admin" + ], + "summary": "retrieving tasks for a specific project.", + "operationId": "getProjectTasks", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "project id to find tasks for", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "example": "0815" + } + ], + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CTask" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "ui-admin" + ], + "summary": "create a new task for an existing project", + "operationId": "createTaskForProject", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "project id for task to change", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "example": "0815" + } + ], + "requestBody": { + "description": "new task data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTask" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "task created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTask" + } + } + } + }, + "403": { + "description": "not authorized as project lead or admin", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTask" + } + } + } + }, + "404": { + "description": "project not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseStatusException" + } + } + } + } + } + } + }, + "/rest/task/{taskId}/assignment": { + "get": { + "tags": [ + "ui-admin" + ], + "summary": "retrieving team member assignments for a specific task.", + "operationId": "getTaskAssignments", + "parameters": [ + { + "name": "taskId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CTaskAssignment" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "ui-admin" + ], + "summary": "add a new assignment to an existing task.", + "operationId": "createAssignment", + "parameters": [ + { + "name": "taskId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTaskAssignment" + } + } + } + }, + "responses": { + "201": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTaskAssignment" + } + } + } + } + } + } + }, + "/rest/task/{taskId}": { + "get": { + "tags": [ + "ui-admin" + ], + "summary": "retrieving a specific task.", + "operationId": "getTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CTask" + } + } + } + } + } + }, + "put": { + "tags": [ + "ui-admin" + ], + "summary": "change an existing task.", + "operationId": "changeTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTask" + } + } + } + }, + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Task" + } + } + } + } + } + }, + "delete": { + "tags": [ + "ui-admin" + ], + "summary": "delete an existing task.", + "operationId": "deleteTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + }, + "/rest/task/{taskId}/assignment/{assignmentId}": { + "put": { + "tags": [ + "ui-admin" + ], + "summary": "change from/until of given assignment", + "operationId": "changeAssignment", + "parameters": [ + { + "name": "taskId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "assignmentId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTaskAssignment" + } + } + } + }, + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CTaskAssignment" + } + } + } + } + } + }, + "delete": { + "tags": [ + "ui-admin" + ], + "summary": "delete an existing assignment from task", + "operationId": "deleteAssignment", + "parameters": [ + { + "name": "taskId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "assignmentId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + }, + "/rest/teammember": { + "get": { + "tags": [ + "ui-admin", + "ui-user" + ], + "summary": "retrieving all known users.", + "operationId": "getTeamMembers", + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CTeamMember" + } + } + } + } + } + } + } + }, + "/rest/workweek/{from-iso-date-string}": { + "get": { + "tags": [ + "ui-user" + ], + "summary": "retrieving work week for given week, date format: /rest/workweek/YYYY-MM-DD.", + "operationId": "getWorkWeek", + "parameters": [ + { + "name": "from-iso-date-string", + "in": "path", + "description": "date, start of week, format YYYY-MM-DD", + "required": true, + "schema": { + "type": "string" + }, + "example": "2019-03-11" + } + ], + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkWeek" + } + } + } + } + } + }, + "put": { + "tags": [ + "ui-user" + ], + "summary": "update work done for given week", + "operationId": "updateWorkWeek", + "parameters": [ + { + "name": "from-iso-date-string", + "in": "path", + "description": "date, start of week, format YYYY-MM-DD", + "required": true, + "schema": { + "type": "string" + }, + "example": "2019-03-11" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkWeek" + } + } + } + }, + "responses": { + "200": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AuthenticationRequest": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "password": { + "type": "string" + } + } + }, + "AuthenticationResult": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "token": { + "type": "string" + } + } + }, + "CProject": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "projectLeads": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CTeamMember" + } + } + } + }, + "CTeamMember": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "userId": { + "type": "string" + } + } + }, + "CTask": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "ResponseStatusException": { + "type": "object", + "properties": { + "mostSpecificCause": { + "type": "object", + "properties": { + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "message": { + "type": "string" + }, + "suppressed": { + "type": "array", + "items": { + "type": "object", + "properties": { + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "message": { + "type": "string" + }, + "localizedMessage": { + "type": "string" + } + } + } + }, + "localizedMessage": { + "type": "string" + } + } + }, + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "status": { + "type": "string", + "enum": [ + "100 CONTINUE", + "101 SWITCHING_PROTOCOLS", + "102 PROCESSING", + "103 CHECKPOINT", + "200 OK", + "201 CREATED", + "202 ACCEPTED", + "203 NON_AUTHORITATIVE_INFORMATION", + "204 NO_CONTENT", + "205 RESET_CONTENT", + "206 PARTIAL_CONTENT", + "207 MULTI_STATUS", + "208 ALREADY_REPORTED", + "226 IM_USED", + "300 MULTIPLE_CHOICES", + "301 MOVED_PERMANENTLY", + "302 FOUND", + "302 MOVED_TEMPORARILY", + "303 SEE_OTHER", + "304 NOT_MODIFIED", + "305 USE_PROXY", + "307 TEMPORARY_REDIRECT", + "308 PERMANENT_REDIRECT", + "400 BAD_REQUEST", + "401 UNAUTHORIZED", + "402 PAYMENT_REQUIRED", + "403 FORBIDDEN", + "404 NOT_FOUND", + "405 METHOD_NOT_ALLOWED", + "406 NOT_ACCEPTABLE", + "407 PROXY_AUTHENTICATION_REQUIRED", + "408 REQUEST_TIMEOUT", + "409 CONFLICT", + "410 GONE", + "411 LENGTH_REQUIRED", + "412 PRECONDITION_FAILED", + "413 PAYLOAD_TOO_LARGE", + "413 REQUEST_ENTITY_TOO_LARGE", + "414 URI_TOO_LONG", + "414 REQUEST_URI_TOO_LONG", + "415 UNSUPPORTED_MEDIA_TYPE", + "416 REQUESTED_RANGE_NOT_SATISFIABLE", + "417 EXPECTATION_FAILED", + "418 I_AM_A_TEAPOT", + "419 INSUFFICIENT_SPACE_ON_RESOURCE", + "420 METHOD_FAILURE", + "421 DESTINATION_LOCKED", + "422 UNPROCESSABLE_ENTITY", + "423 LOCKED", + "424 FAILED_DEPENDENCY", + "425 TOO_EARLY", + "426 UPGRADE_REQUIRED", + "428 PRECONDITION_REQUIRED", + "429 TOO_MANY_REQUESTS", + "431 REQUEST_HEADER_FIELDS_TOO_LARGE", + "451 UNAVAILABLE_FOR_LEGAL_REASONS", + "500 INTERNAL_SERVER_ERROR", + "501 NOT_IMPLEMENTED", + "502 BAD_GATEWAY", + "503 SERVICE_UNAVAILABLE", + "504 GATEWAY_TIMEOUT", + "505 HTTP_VERSION_NOT_SUPPORTED", + "506 VARIANT_ALSO_NEGOTIATES", + "507 INSUFFICIENT_STORAGE", + "508 LOOP_DETECTED", + "509 BANDWIDTH_LIMIT_EXCEEDED", + "510 NOT_EXTENDED", + "511 NETWORK_AUTHENTICATION_REQUIRED" + ] + }, + "reason": { + "type": "string" + }, + "message": { + "type": "string" + }, + "rootCause": { + "type": "object", + "properties": { + "cause": { + "type": "object", + "properties": { + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "message": { + "type": "string" + }, + "suppressed": { + "type": "array", + "items": { + "type": "object", + "properties": { + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "message": { + "type": "string" + }, + "localizedMessage": { + "type": "string" + } + } + } + }, + "localizedMessage": { + "type": "string" + } + } + }, + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "message": { + "type": "string" + }, + "suppressed": { + "type": "array", + "items": { + "type": "object", + "properties": { + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "message": { + "type": "string" + }, + "localizedMessage": { + "type": "string" + } + } + } + }, + "localizedMessage": { + "type": "string" + } + } + }, + "suppressed": { + "type": "array", + "items": { + "type": "object", + "properties": { + "stackTrace": { + "type": "array", + "items": { + "type": "object", + "properties": { + "classLoaderName": { + "type": "string" + }, + "moduleName": { + "type": "string" + }, + "moduleVersion": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "className": { + "type": "string" + }, + "nativeMethod": { + "type": "boolean" + } + } + } + }, + "message": { + "type": "string" + }, + "localizedMessage": { + "type": "string" + } + } + } + }, + "localizedMessage": { + "type": "string" + } + } + }, + "CTaskAssignment": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "task": { + "$ref": "#/components/schemas/CTask" + }, + "teamMember": { + "$ref": "#/components/schemas/CTeamMember" + }, + "from": { + "type": "string", + "format": "date" + }, + "until": { + "type": "string", + "format": "date" + } + } + }, + "Project": { + "required": [ + "active", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "unique project id.", + "format": "int64", + "example": 815 + }, + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string", + "description": "unique descriptive name", + "example": "my unique project name" + }, + "active": { + "type": "boolean", + "description": "is project active for administration by project lead.", + "example": true + }, + "projectLeads": { + "type": "array", + "description": "project leads (administrator)", + "items": { + "$ref": "#/components/schemas/TeamMember" + } + } + }, + "description": "tracked project." + }, + "Task": { + "required": [ + "name", + "project", + "state" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string", + "description": "unique descriptive name", + "example": "first task: do something" + }, + "state": { + "type": "string", + "enum": [ + "PLANNED", + "ACTIVE", + "DONE" + ] + }, + "project": { + "$ref": "#/components/schemas/Project" + } + }, + "description": "a project task to be worked on." + }, + "TeamMember": { + "required": [ + "name", + "userId" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "unique internal member id", + "format": "int64", + "example": 4712 + }, + "name": { + "maxLength": 100, + "type": "string", + "description": "unique descriptive name", + "example": "Tom Teammember" + }, + "userId": { + "maxLength": 100, + "type": "string", + "description": "unique descriptive name", + "example": "tlead1" + } + }, + "description": "a team member, could be project lead or an member with assigned tasks." + }, + "TaskWeek": { + "type": "object", + "properties": { + "taskId": { + "type": "integer", + "description": "task unique id", + "format": "int64" + }, + "taskName": { + "type": "string" + }, + "workHours": { + "type": "array", + "description": "7 days array of working hours", + "items": { + "$ref": "#/components/schemas/WorkHoursAssigned" + } + } + }, + "description": "one week of working hours for a given task." + }, + "WorkHoursAssigned": { + "type": "object", + "properties": { + "workHours": { + "type": "integer", + "description": "working hours done for given task on this day", + "format": "int32" + }, + "readOnly": { + "type": "boolean", + "description": "current user is able to change values for this day and task." + } + }, + "description": "7 days array of working hours" + }, + "WorkWeek": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "start of week", + "format": "date", + "example": "2019-01-02" + }, + "until": { + "type": "string", + "description": "last day of week", + "format": "date", + "example": "2019-01-08" + }, + "taskWeeks": { + "type": "array", + "description": "list of tasks for this week", + "items": { + "$ref": "#/components/schemas/TaskWeek" + } + } + }, + "description": "week, holds all work and working assignments." + } + }, + "securitySchemes": { + "Authentication": { + "type": "apiKey", + "description": "auth with jwt bearer token in 'Authentication' header of proctected requests.", + "name": "Authentication", + "in": "header" + } + } + } +} diff --git a/modules/openapi-generator/src/test/resources/3_0/composition.yaml b/modules/openapi-generator/src/test/resources/3_0/composition.yaml new file mode 100644 index 00000000000..0b54cb26d40 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/composition.yaml @@ -0,0 +1,121 @@ +openapi: 3.0.0 +info: + title: Composition and Inheritence (Polymorphism) + version: 1.0.0 +paths: + /oneOf: + post: + summary: One of + responses: + 200: + description: Response + content: + application/json: + schema: + $ref: '#/components/schemas/OneOf' + /oneOfWithDiscriminator: + post: + summary: One of with discriminator + responses: + 200: + description: Response + content: + application/json: + schema: + $ref: '#/components/schemas/OneOfWithDiscriminator' + /oneOfWithAllOfDiscriminator: + post: + summary: One of with discriminator from all of + responses: + 200: + description: Response + content: + application/json: + schema: + $ref: '#/components/schemas/OneOfWithAllOfDiscriminator' + /allOf: + post: + summary: All of + responses: + 200: + description: Response + content: + application/json: + schema: + $ref: '#/components/schemas/AllOf' + /allOfWithDiscriminator: + post: + summary: All of with discriminator + responses: + 200: + description: Response + content: + application/json: + schema: + $ref: '#/components/schemas/BaseObject' +components: + schemas: + OneOf: + oneOf: + - $ref: "#/components/schemas/ObjectA" + - $ref: "#/components/schemas/ObjectB" + OneOfWithDiscriminator: + oneOf: + - $ref: "#/components/schemas/ObjectA" + - $ref: "#/components/schemas/ObjectB" + discriminator: + propertyName: objectType + mapping: + a: "#/components/schemas/ObjectA" + b: "#/components/schemas/ObjectB" + OneOfWithAllOfDiscriminator: + oneOf: + - $ref: "#/components/schemas/SubObjectA" + - $ref: "#/components/schemas/SubObjectB" + AllOf: + allOf: + - $ref: "#/components/schemas/ObjectA" + - $ref: "#/components/schemas/ObjectB" + BaseObject: + required: + - objectType + - value + properties: + objectType: + type: string + value: + type: boolean + discriminator: + propertyName: objectType + ObjectA: + type: object + required: + - objectType + properties: + objectType: + type: string + valueA: + type: string + ObjectB: + type: object + required: + - objectType + properties: + objectType: + type: string + valueB: + type: number + SubObjectA: + allOf: + - $ref: "#/components/schemas/BaseObject" + - type: object + properties: + valueA: + type: string + SubObjectB: + allOf: + - $ref: "#/components/schemas/BaseObject" + - type: object + properties: + valueB: + type: number diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml index 661961cd977..2e558056871 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml @@ -101,6 +101,20 @@ paths: responses: '200': description: 'OK' + /readonly_auth_scheme: + get: + security: + - authScheme: ["test.read"] + responses: + 200: + description: Check that limiting to a single required auth scheme works + /multiple_auth_scheme: + get: + security: + - authScheme: ["test.read", "test.write"] + responses: + 200: + description: Check that limiting to multiple required auth schemes works /responses_with_headers: get: responses: @@ -123,7 +137,18 @@ paths: Failure-Info: schema: type: String + components: + securitySchemes: + authScheme: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: 'http://example.org' + tokenUrl: 'http://example.org' + scopes: + test.read: Allowed to read state. + test.write: Allowed to change state. schemas: UuidObject: description: Test a model containing a UUID diff --git a/pom.xml b/pom.xml index c4e35099e2c..bf0e1b87d75 100644 --- a/pom.xml +++ b/pom.xml @@ -1251,6 +1251,8 @@ samples/client/petstore/erlang-proper samples/client/petstore/kotlin-multiplatform samples/client/petstore/kotlin/ + samples/client/petstore/kotlin-gson/ + samples/client/petstore/kotlin-nonpublic/ samples/client/petstore/kotlin-okhttp3/ samples/client/petstore/kotlin-threetenbp/ samples/client/petstore/kotlin-string/ @@ -1306,12 +1308,13 @@ samples/client/petstore/swift4/default/SwaggerClientTests samples/client/petstore/swift4/promisekit/SwaggerClientTests samples/client/petstore/swift4/rxswift/SwaggerClientTests + @@ -1392,7 +1395,7 @@ 1.8 2.0.10 io.swagger.parser.v3 - 2.0.15 + 2.0.16 2.11.1 3.3.1 2.4 diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/c/.openapi-generator-ignore b/samples/client/petstore/c/.openapi-generator-ignore index 7484ee590a3..f574e0daf8f 100644 --- a/samples/client/petstore/c/.openapi-generator-ignore +++ b/samples/client/petstore/c/.openapi-generator-ignore @@ -21,3 +21,4 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +CMakeLists.txt diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index afa63656064..d168f1d8bda 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/CMakeLists.txt b/samples/client/petstore/c/CMakeLists.txt index 404cf6f17f9..1de992031da 100644 --- a/samples/client/petstore/c/CMakeLists.txt +++ b/samples/client/petstore/c/CMakeLists.txt @@ -52,10 +52,14 @@ set(HDRS ) +# Add library with project file with projectname as library name add_library(${pkgName} SHARED ${SRCS} ${HDRS}) +# Link dependent libraries target_link_libraries(${pkgName} ${CURL_LIBRARIES} ) +#install library to destination install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) +# Setting file variables to null set(SRCS "") set(HDRS "") diff --git a/samples/client/petstore/c/README.md b/samples/client/petstore/c/README.md index 56b9a34abed..0059cc47da8 100644 --- a/samples/client/petstore/c/README.md +++ b/samples/client/petstore/c/README.md @@ -8,7 +8,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat - Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen ## Installation -You'll need the `curl 7.58.0` package in order to build the API. To have code formatted nicely you also need to have uncrustify version 0.67. +You'll need the `curl 7.58.0` package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later. # Prerequisites @@ -34,11 +34,11 @@ sudo make install ``` ## Compile the sample: -This will compile the generated code and create a library in build folder which has to be linked to the codes where API will be used. +This will compile the generated code and create a library in the build folder which has to be linked to the codes where API will be used. ```bash mkdir build cd build -// To install library to specific location use following command +// To install library to specific location, use following commands cmake -DCMAKE_INSTALL_PREFIX=/pathtolocaiton .. // for normal install use following command cmake .. @@ -52,11 +52,11 @@ To compile main.c(considering the file is present in build folder) use following -L - locaiton of the library(not required if cmake with normal installation is performed) -l library name ```bash -gcc main.c -L. -lpetstore -o main +gcc main.c -L. -lopenapi_petstore -o main ``` -once compile, you can run it with ``` ./main ``` +Once compiled, you can run it with ``` ./main ``` -Note: You dont need to specify includes for models and include folder seperately as they are path linked. You just have to import the api.h file in your code, the include linking will work. +Note: You don't need to specify includes for models and include folder seperately as they are path linked. You just have to import the api.h file in your code, the include linking will work. ## Author diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index ad31d72f11e..cc7bc440c84 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -351,7 +351,7 @@ pet_t *PetAPI_getPetById(apiClient_t *apiClient, long petId) { // nonprimitive not container cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); pet_t *elementToReturn = pet_parseFromJSON(PetAPIlocalVarJSON); - cJSON_Delete(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); if(elementToReturn == NULL) { // return 0; } @@ -606,7 +606,7 @@ api_response_t *PetAPI_uploadFile(apiClient_t *apiClient, long petId, cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); api_response_t *elementToReturn = api_response_parseFromJSON( PetAPIlocalVarJSON); - cJSON_Delete(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); if(elementToReturn == NULL) { // return 0; } diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c index d1269274a84..11dabde964f 100644 --- a/samples/client/petstore/c/api/StoreAPI.c +++ b/samples/client/petstore/c/api/StoreAPI.c @@ -111,7 +111,8 @@ list_t *StoreAPI_getInventory(apiClient_t *apiClient) { list_t *elementToReturn = list_create(); cJSON_ArrayForEach(VarJSON, localVarJSON) { keyValuePair_t *keyPair = - keyValuePair_create(strdup(VarJSON->string), cJSON_Print( + keyValuePair_create(strdup( + VarJSON->string), cJSON_Print( VarJSON)); list_addElement(elementToReturn, keyPair); } @@ -191,7 +192,7 @@ order_t *StoreAPI_getOrderById(apiClient_t *apiClient, long orderId) { // nonprimitive not container cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); - cJSON_Delete(StoreAPIlocalVarJSON); + cJSON_Delete(StoreAPIlocalVarJSON); if(elementToReturn == NULL) { // return 0; } @@ -259,7 +260,7 @@ order_t *StoreAPI_placeOrder(apiClient_t *apiClient, order_t *body) { // nonprimitive not container cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); - cJSON_Delete(StoreAPIlocalVarJSON); + cJSON_Delete(StoreAPIlocalVarJSON); if(elementToReturn == NULL) { // return 0; } diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c index ae618b88696..9170293951e 100644 --- a/samples/client/petstore/c/api/UserAPI.c +++ b/samples/client/petstore/c/api/UserAPI.c @@ -331,7 +331,7 @@ user_t *UserAPI_getUserByName(apiClient_t *apiClient, char *username) { // nonprimitive not container cJSON *UserAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); user_t *elementToReturn = user_parseFromJSON(UserAPIlocalVarJSON); - cJSON_Delete(UserAPIlocalVarJSON); + cJSON_Delete(UserAPIlocalVarJSON); if(elementToReturn == NULL) { // return 0; } diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index afb0e096cf1..eb569bd27a3 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -22,7 +22,7 @@ apiClient_t *apiClient_create() { } void apiClient_free(apiClient_t *apiClient) { - if(apiClient->apiKeys) { + if(apiClient->accessToken) { list_free(apiClient->apiKeys); } if(apiClient->accessToken) { diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index c3a2c7076fa..d168f1d8bda 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp index 72f68c1dbd6..da684cfc7f5 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp +++ b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp @@ -3,8 +3,8 @@ #include #include -OAIPet PetApiTests::createRandomPet() { - OAIPet pet; +PFXPet PetApiTests::createRandomPet() { + PFXPet pet; qint64 id = QDateTime::currentMSecsSinceEpoch(); pet.setName("monster"); pet.setId(id); @@ -13,14 +13,13 @@ OAIPet PetApiTests::createRandomPet() { } void PetApiTests::findPetsByStatusTest() { - OAIPetApi api; - api.setHost(PetStoreHost); + PFXPetApi api; QEventLoop loop; bool petFound = false; - connect(&api, &OAIPetApi::findPetsByStatusSignal, [&](QList pets) { + connect(&api, &PFXPetApi::findPetsByStatusSignal, [&](QList pets) { petFound = true; - foreach(OAIPet pet, pets) { + foreach(PFXPet pet, pets) { QVERIFY(pet.getStatus().startsWith("available") || pet.getStatus().startsWith("sold")); } loop.quit(); @@ -33,18 +32,17 @@ void PetApiTests::findPetsByStatusTest() { } void PetApiTests::createAndGetPetTest() { - OAIPetApi api; - api.setHost(PetStoreHost); + PFXPetApi api; QEventLoop loop; bool petCreated = false; - connect(&api, &OAIPetApi::addPetSignal, [&]() { + connect(&api, &PFXPetApi::addPetSignal, [&]() { // pet created petCreated = true; loop.quit(); }); - OAIPet pet = createRandomPet(); + PFXPet pet = createRandomPet(); qint64 id = pet.getId(); api.addPet(pet); @@ -54,7 +52,7 @@ void PetApiTests::createAndGetPetTest() { bool petFetched = false; - connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { + connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { QVERIFY(pet.getId() > 0); QVERIFY(pet.getStatus().compare("freaky") == 0); loop.quit(); @@ -65,20 +63,18 @@ void PetApiTests::createAndGetPetTest() { QTimer::singleShot(14000, &loop, &QEventLoop::quit); loop.exec(); QVERIFY2(petFetched, "didn't finish within timeout"); - } void PetApiTests::updatePetTest() { - OAIPetApi api; - api.setHost(PetStoreHost); + PFXPetApi api; - OAIPet pet = createRandomPet(); - OAIPet petToCheck; + PFXPet pet = createRandomPet(); + PFXPet petToCheck; qint64 id = pet.getId(); QEventLoop loop; bool petAdded = false; - connect(&api, &OAIPetApi::addPetSignal, [&](){ + connect(&api, &PFXPetApi::addPetSignal, [&](){ petAdded = true; loop.quit(); }); @@ -92,7 +88,7 @@ void PetApiTests::updatePetTest() { // fetch it bool petFetched = false; - connect(&api, &OAIPetApi::getPetByIdSignal, this, [&](OAIPet pet) { + connect(&api, &PFXPetApi::getPetByIdSignal, this, [&](PFXPet pet) { petFetched = true; petToCheck = pet; loop.quit(); @@ -106,7 +102,7 @@ void PetApiTests::updatePetTest() { // update it bool petUpdated = false; - connect(&api, &OAIPetApi::updatePetSignal, [&]() { + connect(&api, &PFXPetApi::updatePetSignal, [&]() { petUpdated = true; loop.quit(); }); @@ -120,7 +116,7 @@ void PetApiTests::updatePetTest() { // check it bool petFetched2 = false; - connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { + connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { petFetched2 = true; QVERIFY(pet.getId() == petToCheck.getId()); QVERIFY(pet.getStatus().compare(petToCheck.getStatus()) == 0); @@ -133,17 +129,16 @@ void PetApiTests::updatePetTest() { } void PetApiTests::updatePetWithFormTest() { - OAIPetApi api; - api.setHost(PetStoreHost); + PFXPetApi api; - OAIPet pet = createRandomPet(); - OAIPet petToCheck; + PFXPet pet = createRandomPet(); + PFXPet petToCheck; qint64 id = pet.getId(); QEventLoop loop; // create pet bool petAdded = false; - connect(&api, &OAIPetApi::addPetSignal, [&](){ + connect(&api, &PFXPetApi::addPetSignal, [&](){ petAdded = true; loop.quit(); }); @@ -155,7 +150,7 @@ void PetApiTests::updatePetWithFormTest() { // fetch it bool petFetched = false; - connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { + connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { petFetched = true; petToCheck = pet; loop.quit(); @@ -168,7 +163,7 @@ void PetApiTests::updatePetWithFormTest() { // update it bool petUpdated = false; - connect(&api, &OAIPetApi::updatePetWithFormSignal, [&](){ + connect(&api, &PFXPetApi::updatePetWithFormSignal, [&](){ petUpdated = true; loop.quit(); }); @@ -181,7 +176,7 @@ void PetApiTests::updatePetWithFormTest() { // fetch it bool petUpdated2 = false; - connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { + connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { petUpdated2 = true; QVERIFY(pet.getName().compare(QString("gorilla")) == 0); loop.quit(); diff --git a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.h b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.h index 3f1a68f4b14..ec126905cf5 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.h +++ b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.h @@ -1,19 +1,17 @@ #pragma once -#include "../client/OAIPetApi.h" +#include "../client/PFXPetApi.h" -using namespace OpenAPI; +using namespace test_namespace; class PetApiTests: public QObject { Q_OBJECT - OAIPet createRandomPet(); + PFXPet createRandomPet(); private slots: void findPetsByStatusTest(); void createAndGetPetTest(); void updatePetTest(); void updatePetWithFormTest(); -private: - const QString PetStoreHost = QStringLiteral("http://petstore.swagger.io"); }; diff --git a/samples/client/petstore/cpp-qt5/PetStore/PetStore.pro b/samples/client/petstore/cpp-qt5/PetStore/PetStore.pro index 2e43c3f7dc8..88d64d63958 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/PetStore.pro +++ b/samples/client/petstore/cpp-qt5/PetStore/PetStore.pro @@ -16,12 +16,12 @@ CONFIG += c++11 TEMPLATE = app -include(../client/client.pri) +include(../client/PFXclient.pri) SOURCES += main.cpp \ - PetApiTests.cpp \ - StoreApiTests.cpp \ - UserApiTests.cpp + PetApiTests.cpp \ + StoreApiTests.cpp \ + UserApiTests.cpp HEADERS += PetApiTests.h \ StoreApiTests.h \ diff --git a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp index 9433d5be957..282d40cac10 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp +++ b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp @@ -5,24 +5,23 @@ #include void StoreApiTests::placeOrderTest() { - OAIStoreApi api; - api.setHost(PetStoreHost); + PFXStoreApi api; QEventLoop loop; bool orderPlaced = false; - connect(&api, &OAIStoreApi::placeOrderSignal, [&](OAIOrder order) { + connect(&api, &PFXStoreApi::placeOrderSignal, [&](PFXOrder order) { orderPlaced = true; QVERIFY(order.getPetId() == 10000); QVERIFY((order.getId() == 500)); qDebug() << order.getShipDate(); loop.quit(); }); - connect(&api, &OAIStoreApi::placeOrderSignalE, [&](){ + connect(&api, &PFXStoreApi::placeOrderSignalE, [&](){ QFAIL("shouldn't trigger error"); loop.quit(); }); - OAIOrder order; + PFXOrder order; order.setId(500); order.setQuantity(10); order.setPetId(10000); @@ -33,16 +32,14 @@ void StoreApiTests::placeOrderTest() { QTimer::singleShot(14000, &loop, &QEventLoop::quit); loop.exec(); QVERIFY2(orderPlaced, "didn't finish within timeout"); - } void StoreApiTests::getOrderByIdTest() { - OAIStoreApi api; - api.setHost(PetStoreHost); + PFXStoreApi api; QEventLoop loop; bool orderFetched = false; - connect(&api, &OAIStoreApi::getOrderByIdSignal, [&](OAIOrder order) { + connect(&api, &PFXStoreApi::getOrderByIdSignal, [&](PFXOrder order) { orderFetched = true; QVERIFY(order.getPetId() == 10000); QVERIFY((order.getId() == 500)); @@ -54,16 +51,14 @@ void StoreApiTests::getOrderByIdTest() { QTimer::singleShot(14000, &loop, &QEventLoop::quit); loop.exec(); QVERIFY2(orderFetched, "didn't finish within timeout"); - } void StoreApiTests::getInventoryTest() { - OAIStoreApi api; - api.setHost(PetStoreHost); + PFXStoreApi api; QEventLoop loop; bool inventoryFetched = false; - connect(&api, &OAIStoreApi::getInventorySignal, [&](QMap status) { + connect(&api, &PFXStoreApi::getInventorySignal, [&](QMap status) { inventoryFetched = true; for(const auto& key : status.keys()) { qDebug() << (key) << " Quantities " << status.value(key); @@ -75,5 +70,4 @@ void StoreApiTests::getInventoryTest() { QTimer::singleShot(14000, &loop, &QEventLoop::quit); loop.exec(); QVERIFY2(inventoryFetched, "didn't finish within timeout"); - } diff --git a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.h b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.h index 40023ae6b87..440bf181c54 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.h +++ b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.h @@ -1,8 +1,8 @@ #pragma once -#include "../client/OAIStoreApi.h" +#include "../client/PFXStoreApi.h" -using namespace OpenAPI; +using namespace test_namespace; class StoreApiTests: public QObject { Q_OBJECT @@ -11,6 +11,4 @@ private slots: void placeOrderTest(); void getOrderByIdTest(); void getInventoryTest(); -private: - const QString PetStoreHost = QStringLiteral("http://petstore.swagger.io"); }; diff --git a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp index 68a28f40156..c047724372a 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp +++ b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp @@ -4,8 +4,8 @@ #include #include -OAIUser UserApiTests::createRandomUser() { - OAIUser user; +PFXUser UserApiTests::createRandomUser() { + PFXUser user; user.setId(QDateTime::currentMSecsSinceEpoch()); user.setEmail("Jane.Doe@openapitools.io"); user.setFirstName("Jane"); @@ -18,12 +18,11 @@ OAIUser UserApiTests::createRandomUser() { } void UserApiTests::createUserTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool userCreated = false; - connect(&api, &OAIUserApi::createUserSignal, [&](){ + connect(&api, &PFXUserApi::createUserSignal, [&](){ userCreated = true; loop.quit(); }); @@ -35,17 +34,16 @@ void UserApiTests::createUserTest(){ } void UserApiTests::createUsersWithArrayInputTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool usersCreated = false; - connect(&api, &OAIUserApi::createUsersWithArrayInputSignal, [&](){ + connect(&api, &PFXUserApi::createUsersWithArrayInputSignal, [&](){ usersCreated = true; loop.quit(); }); - QList users; + QList users; users.append(createRandomUser()); users.append(createRandomUser()); users.append(createRandomUser()); @@ -56,17 +54,16 @@ void UserApiTests::createUsersWithArrayInputTest(){ } void UserApiTests::createUsersWithListInputTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool usersCreated = false; - connect(&api, &OAIUserApi::createUsersWithListInputSignal, [&](){ + connect(&api, &PFXUserApi::createUsersWithListInputSignal, [&](){ usersCreated = true; loop.quit(); }); - QList users; + QList users; auto johndoe = createRandomUser(); johndoe.setUsername("johndoe"); auto rambo = createRandomUser(); @@ -81,12 +78,11 @@ void UserApiTests::createUsersWithListInputTest(){ } void UserApiTests::deleteUserTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool userDeleted = false; - connect(&api, &OAIUserApi::deleteUserSignal, [&](){ + connect(&api, &PFXUserApi::deleteUserSignal, [&](){ userDeleted = true; loop.quit(); }); @@ -98,12 +94,11 @@ void UserApiTests::deleteUserTest(){ } void UserApiTests::getUserByNameTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool userFetched = false; - connect(&api, &OAIUserApi::getUserByNameSignal, [&](OAIUser summary) { + connect(&api, &PFXUserApi::getUserByNameSignal, [&](PFXUser summary) { userFetched = true; qDebug() << summary.getUsername(); QVERIFY(summary.getUsername() == "johndoe"); @@ -117,12 +112,11 @@ void UserApiTests::getUserByNameTest(){ } void UserApiTests::loginUserTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool userLogged = false; - connect(&api, &OAIUserApi::loginUserSignal, [&](QString summary) { + connect(&api, &PFXUserApi::loginUserSignal, [&](QString summary) { userLogged = true; qDebug() << summary; loop.quit(); @@ -135,12 +129,11 @@ void UserApiTests::loginUserTest(){ } void UserApiTests::logoutUserTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool userLoggedOut = false; - connect(&api, &OAIUserApi::logoutUserSignal, [&](){ + connect(&api, &PFXUserApi::logoutUserSignal, [&](){ userLoggedOut = true; loop.quit(); }); @@ -152,12 +145,11 @@ void UserApiTests::logoutUserTest(){ } void UserApiTests::updateUserTest(){ - OAIUserApi api; - api.setHost(PetStoreHost); + PFXUserApi api; QEventLoop loop; bool userUpdated = false; - connect(&api, &OAIUserApi::updateUserSignal, [&]() { + connect(&api, &PFXUserApi::updateUserSignal, [&]() { userUpdated = true; loop.quit(); }); diff --git a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.h b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.h index 04dfcabd853..3cfd25bd8fe 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.h +++ b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.h @@ -1,13 +1,13 @@ #pragma once -#include "../client/OAIUserApi.h" +#include "../client/PFXUserApi.h" -using namespace OpenAPI; +using namespace test_namespace; class UserApiTests: public QObject { Q_OBJECT - OAIUser createRandomUser(); + PFXUser createRandomUser(); private slots: void createUserTest(); @@ -18,6 +18,4 @@ private slots: void loginUserTest(); void logoutUserTest(); void updateUserTest(); -private: - const QString PetStoreHost = QStringLiteral("http://petstore.swagger.io"); }; diff --git a/samples/client/petstore/cpp-qt5/client/OAIPetApi.h b/samples/client/petstore/cpp-qt5/client/OAIPetApi.h deleted file mode 100644 index 56e8eecce31..00000000000 --- a/samples/client/petstore/cpp-qt5/client/OAIPetApi.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef OAI_OAIPetApi_H -#define OAI_OAIPetApi_H - -#include "OAIHttpRequest.h" - -#include "OAIApiResponse.h" -#include "OAIHttpFileElement.h" -#include "OAIPet.h" -#include - -#include - -namespace OpenAPI { - -class OAIPetApi: public QObject { - Q_OBJECT - -public: - OAIPetApi(); - OAIPetApi(const QString& host, const QString& basePath, const int toutMs = 0); - ~OAIPetApi(); - - void setBasePath(const QString& basePath); - void setHost(const QString& host); - void setApiTimeOutMs(const int tout); - void setWorkingDirectory(const QString& path); - void addHeaders(const QString& key, const QString& value); - - void addPet(const OAIPet& body); - void deletePet(const qint64& pet_id, const QString& api_key); - void findPetsByStatus(const QList& status); - void findPetsByTags(const QList& tags); - void getPetById(const qint64& pet_id); - void updatePet(const OAIPet& body); - void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status); - void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpFileElement& file); - -private: - QString basePath; - QString host; - QString workingDirectory; - int timeout; - QMap defaultHeaders; - void addPetCallback (OAIHttpRequestWorker * worker); - void deletePetCallback (OAIHttpRequestWorker * worker); - void findPetsByStatusCallback (OAIHttpRequestWorker * worker); - void findPetsByTagsCallback (OAIHttpRequestWorker * worker); - void getPetByIdCallback (OAIHttpRequestWorker * worker); - void updatePetCallback (OAIHttpRequestWorker * worker); - void updatePetWithFormCallback (OAIHttpRequestWorker * worker); - void uploadFileCallback (OAIHttpRequestWorker * worker); - -signals: - void addPetSignal(); - void deletePetSignal(); - void findPetsByStatusSignal(QList summary); - void findPetsByTagsSignal(QList summary); - void getPetByIdSignal(OAIPet summary); - void updatePetSignal(); - void updatePetWithFormSignal(); - void uploadFileSignal(OAIApiResponse summary); - - void addPetSignalFull(OAIHttpRequestWorker* worker); - void deletePetSignalFull(OAIHttpRequestWorker* worker); - void findPetsByStatusSignalFull(OAIHttpRequestWorker* worker, QList summary); - void findPetsByTagsSignalFull(OAIHttpRequestWorker* worker, QList summary); - void getPetByIdSignalFull(OAIHttpRequestWorker* worker, OAIPet summary); - void updatePetSignalFull(OAIHttpRequestWorker* worker); - void updatePetWithFormSignalFull(OAIHttpRequestWorker* worker); - void uploadFileSignalFull(OAIHttpRequestWorker* worker, OAIApiResponse summary); - - void addPetSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void deletePetSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByStatusSignalE(QList summary, QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByTagsSignalE(QList summary, QNetworkReply::NetworkError error_type, QString error_str); - void getPetByIdSignalE(OAIPet summary, QNetworkReply::NetworkError error_type, QString error_str); - void updatePetSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void uploadFileSignalE(OAIApiResponse summary, QNetworkReply::NetworkError error_type, QString error_str); - - void addPetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void deletePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByStatusSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByTagsSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getPetByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void updatePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void updatePetWithFormSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void uploadFileSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - -}; - -} -#endif diff --git a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h deleted file mode 100644 index 317550ec170..00000000000 --- a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef OAI_OAIStoreApi_H -#define OAI_OAIStoreApi_H - -#include "OAIHttpRequest.h" - -#include "OAIOrder.h" -#include -#include - -#include - -namespace OpenAPI { - -class OAIStoreApi: public QObject { - Q_OBJECT - -public: - OAIStoreApi(); - OAIStoreApi(const QString& host, const QString& basePath, const int toutMs = 0); - ~OAIStoreApi(); - - void setBasePath(const QString& basePath); - void setHost(const QString& host); - void setApiTimeOutMs(const int tout); - void setWorkingDirectory(const QString& path); - void addHeaders(const QString& key, const QString& value); - - void deleteOrder(const QString& order_id); - void getInventory(); - void getOrderById(const qint64& order_id); - void placeOrder(const OAIOrder& body); - -private: - QString basePath; - QString host; - QString workingDirectory; - int timeout; - QMap defaultHeaders; - void deleteOrderCallback (OAIHttpRequestWorker * worker); - void getInventoryCallback (OAIHttpRequestWorker * worker); - void getOrderByIdCallback (OAIHttpRequestWorker * worker); - void placeOrderCallback (OAIHttpRequestWorker * worker); - -signals: - void deleteOrderSignal(); - void getInventorySignal(QMap summary); - void getOrderByIdSignal(OAIOrder summary); - void placeOrderSignal(OAIOrder summary); - - void deleteOrderSignalFull(OAIHttpRequestWorker* worker); - void getInventorySignalFull(OAIHttpRequestWorker* worker, QMap summary); - void getOrderByIdSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary); - void placeOrderSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary); - - void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void getInventorySignalE(QMap summary, QNetworkReply::NetworkError error_type, QString error_str); - void getOrderByIdSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString error_str); - void placeOrderSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString error_str); - - void deleteOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getInventorySignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getOrderByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void placeOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - -}; - -} -#endif diff --git a/samples/client/petstore/cpp-qt5/client/OAIUserApi.h b/samples/client/petstore/cpp-qt5/client/OAIUserApi.h deleted file mode 100644 index 7a3ab027155..00000000000 --- a/samples/client/petstore/cpp-qt5/client/OAIUserApi.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef OAI_OAIUserApi_H -#define OAI_OAIUserApi_H - -#include "OAIHttpRequest.h" - -#include "OAIUser.h" -#include -#include - -#include - -namespace OpenAPI { - -class OAIUserApi: public QObject { - Q_OBJECT - -public: - OAIUserApi(); - OAIUserApi(const QString& host, const QString& basePath, const int toutMs = 0); - ~OAIUserApi(); - - void setBasePath(const QString& basePath); - void setHost(const QString& host); - void setApiTimeOutMs(const int tout); - void setWorkingDirectory(const QString& path); - void addHeaders(const QString& key, const QString& value); - - void createUser(const OAIUser& body); - void createUsersWithArrayInput(const QList& body); - void createUsersWithListInput(const QList& body); - void deleteUser(const QString& username); - void getUserByName(const QString& username); - void loginUser(const QString& username, const QString& password); - void logoutUser(); - void updateUser(const QString& username, const OAIUser& body); - -private: - QString basePath; - QString host; - QString workingDirectory; - int timeout; - QMap defaultHeaders; - void createUserCallback (OAIHttpRequestWorker * worker); - void createUsersWithArrayInputCallback (OAIHttpRequestWorker * worker); - void createUsersWithListInputCallback (OAIHttpRequestWorker * worker); - void deleteUserCallback (OAIHttpRequestWorker * worker); - void getUserByNameCallback (OAIHttpRequestWorker * worker); - void loginUserCallback (OAIHttpRequestWorker * worker); - void logoutUserCallback (OAIHttpRequestWorker * worker); - void updateUserCallback (OAIHttpRequestWorker * worker); - -signals: - void createUserSignal(); - void createUsersWithArrayInputSignal(); - void createUsersWithListInputSignal(); - void deleteUserSignal(); - void getUserByNameSignal(OAIUser summary); - void loginUserSignal(QString summary); - void logoutUserSignal(); - void updateUserSignal(); - - void createUserSignalFull(OAIHttpRequestWorker* worker); - void createUsersWithArrayInputSignalFull(OAIHttpRequestWorker* worker); - void createUsersWithListInputSignalFull(OAIHttpRequestWorker* worker); - void deleteUserSignalFull(OAIHttpRequestWorker* worker); - void getUserByNameSignalFull(OAIHttpRequestWorker* worker, OAIUser summary); - void loginUserSignalFull(OAIHttpRequestWorker* worker, QString summary); - void logoutUserSignalFull(OAIHttpRequestWorker* worker); - void updateUserSignalFull(OAIHttpRequestWorker* worker); - - void createUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void deleteUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void getUserByNameSignalE(OAIUser summary, QNetworkReply::NetworkError error_type, QString error_str); - void loginUserSignalE(QString summary, QNetworkReply::NetworkError error_type, QString error_str); - void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void updateUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - - void createUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithArrayInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithListInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void deleteUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getUserByNameSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void loginUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void logoutUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void updateUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - -}; - -} -#endif diff --git a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.cpp b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp similarity index 56% rename from samples/client/petstore/cpp-qt5/client/OAIApiResponse.cpp rename to samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp index 233f607a9cf..81438054c73 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp @@ -11,32 +11,32 @@ */ -#include "OAIApiResponse.h" +#include "PFXApiResponse.h" #include #include #include #include -#include "OAIHelpers.h" +#include "PFXHelpers.h" -namespace OpenAPI { +namespace test_namespace { -OAIApiResponse::OAIApiResponse(QString json) { - this->init(); +PFXApiResponse::PFXApiResponse(QString json) { + this->initializeModel(); this->fromJson(json); } -OAIApiResponse::OAIApiResponse() { - this->init(); +PFXApiResponse::PFXApiResponse() { + this->initializeModel(); } -OAIApiResponse::~OAIApiResponse() { +PFXApiResponse::~PFXApiResponse() { } void -OAIApiResponse::init() { +PFXApiResponse::initializeModel() { m_code_isSet = false; m_code_isValid = false; @@ -46,10 +46,11 @@ OAIApiResponse::init() { m_message_isSet = false; m_message_isValid = false; - } + +} void -OAIApiResponse::fromJson(QString jsonString) { +PFXApiResponse::fromJson(QString jsonString) { QByteArray array (jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -57,21 +58,21 @@ OAIApiResponse::fromJson(QString jsonString) { } void -OAIApiResponse::fromJsonObject(QJsonObject json) { +PFXApiResponse::fromJsonObject(QJsonObject json) { - m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]); + m_code_isValid = ::test_namespace::fromJsonValue(code, json[QString("code")]); + m_code_isSet = !json[QString("code")].isNull() && m_code_isValid; + m_type_isValid = ::test_namespace::fromJsonValue(type, json[QString("type")]); + m_type_isSet = !json[QString("type")].isNull() && m_type_isValid; - m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]); - - - m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]); - + m_message_isValid = ::test_namespace::fromJsonValue(message, json[QString("message")]); + m_message_isSet = !json[QString("message")].isNull() && m_message_isValid; } QString -OAIApiResponse::asJson () const { +PFXApiResponse::asJson () const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); @@ -79,55 +80,55 @@ OAIApiResponse::asJson () const { } QJsonObject -OAIApiResponse::asJsonObject() const { +PFXApiResponse::asJsonObject() const { QJsonObject obj; if(m_code_isSet){ - obj.insert(QString("code"), ::OpenAPI::toJsonValue(code)); + obj.insert(QString("code"), ::test_namespace::toJsonValue(code)); } if(m_type_isSet){ - obj.insert(QString("type"), ::OpenAPI::toJsonValue(type)); + obj.insert(QString("type"), ::test_namespace::toJsonValue(type)); } if(m_message_isSet){ - obj.insert(QString("message"), ::OpenAPI::toJsonValue(message)); + obj.insert(QString("message"), ::test_namespace::toJsonValue(message)); } return obj; } qint32 -OAIApiResponse::getCode() const { +PFXApiResponse::getCode() const { return code; } void -OAIApiResponse::setCode(const qint32 &code) { +PFXApiResponse::setCode(const qint32 &code) { this->code = code; this->m_code_isSet = true; } QString -OAIApiResponse::getType() const { +PFXApiResponse::getType() const { return type; } void -OAIApiResponse::setType(const QString &type) { +PFXApiResponse::setType(const QString &type) { this->type = type; this->m_type_isSet = true; } QString -OAIApiResponse::getMessage() const { +PFXApiResponse::getMessage() const { return message; } void -OAIApiResponse::setMessage(const QString &message) { +PFXApiResponse::setMessage(const QString &message) { this->message = message; this->m_message_isSet = true; } bool -OAIApiResponse::isSet() const { +PFXApiResponse::isSet() const { bool isObjectUpdated = false; do{ if(m_code_isSet){ isObjectUpdated = true; break;} @@ -140,7 +141,7 @@ OAIApiResponse::isSet() const { } bool -OAIApiResponse::isValid() const { +PFXApiResponse::isValid() const { // only required properties are required for the object to be considered valid return true; } diff --git a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.h b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h similarity index 76% rename from samples/client/petstore/cpp-qt5/client/OAIApiResponse.h rename to samples/client/petstore/cpp-qt5/client/PFXApiResponse.h index 7e4d7460383..77f5765b2a8 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.h +++ b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h @@ -11,30 +11,30 @@ */ /* - * OAIApiResponse.h + * PFXApiResponse.h * * Describes the result of uploading an image resource */ -#ifndef OAIApiResponse_H -#define OAIApiResponse_H +#ifndef PFXApiResponse_H +#define PFXApiResponse_H #include #include -#include "OAIObject.h" -#include "OAIEnum.h" +#include "PFXObject.h" +#include "PFXEnum.h" -namespace OpenAPI { +namespace test_namespace { -class OAIApiResponse: public OAIObject { +class PFXApiResponse: public PFXObject { public: - OAIApiResponse(); - OAIApiResponse(QString json); - ~OAIApiResponse() override; + PFXApiResponse(); + PFXApiResponse(QString json); + ~PFXApiResponse() override; QString asJson () const override; QJsonObject asJsonObject() const override; @@ -59,7 +59,7 @@ public: virtual bool isValid() const override; private: - void init(); + void initializeModel(); qint32 code; bool m_code_isSet; @@ -77,6 +77,6 @@ private: } -Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse) +Q_DECLARE_METATYPE(test_namespace::PFXApiResponse) -#endif // OAIApiResponse_H +#endif // PFXApiResponse_H diff --git a/samples/client/petstore/cpp-qt5/client/OAICategory.cpp b/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp similarity index 60% rename from samples/client/petstore/cpp-qt5/client/OAICategory.cpp rename to samples/client/petstore/cpp-qt5/client/PFXCategory.cpp index 571dc37b6fa..5b1404cd7dc 100644 --- a/samples/client/petstore/cpp-qt5/client/OAICategory.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp @@ -11,42 +11,43 @@ */ -#include "OAICategory.h" +#include "PFXCategory.h" #include #include #include #include -#include "OAIHelpers.h" +#include "PFXHelpers.h" -namespace OpenAPI { +namespace test_namespace { -OAICategory::OAICategory(QString json) { - this->init(); +PFXCategory::PFXCategory(QString json) { + this->initializeModel(); this->fromJson(json); } -OAICategory::OAICategory() { - this->init(); +PFXCategory::PFXCategory() { + this->initializeModel(); } -OAICategory::~OAICategory() { +PFXCategory::~PFXCategory() { } void -OAICategory::init() { +PFXCategory::initializeModel() { m_id_isSet = false; m_id_isValid = false; m_name_isSet = false; m_name_isValid = false; - } + +} void -OAICategory::fromJson(QString jsonString) { +PFXCategory::fromJson(QString jsonString) { QByteArray array (jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -54,18 +55,18 @@ OAICategory::fromJson(QString jsonString) { } void -OAICategory::fromJsonObject(QJsonObject json) { +PFXCategory::fromJsonObject(QJsonObject json) { - m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); - - - m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); + m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; } QString -OAICategory::asJson () const { +PFXCategory::asJson () const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); @@ -73,41 +74,41 @@ OAICategory::asJson () const { } QJsonObject -OAICategory::asJsonObject() const { +PFXCategory::asJsonObject() const { QJsonObject obj; if(m_id_isSet){ - obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); } if(m_name_isSet){ - obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); } return obj; } qint64 -OAICategory::getId() const { +PFXCategory::getId() const { return id; } void -OAICategory::setId(const qint64 &id) { +PFXCategory::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } QString -OAICategory::getName() const { +PFXCategory::getName() const { return name; } void -OAICategory::setName(const QString &name) { +PFXCategory::setName(const QString &name) { this->name = name; this->m_name_isSet = true; } bool -OAICategory::isSet() const { +PFXCategory::isSet() const { bool isObjectUpdated = false; do{ if(m_id_isSet){ isObjectUpdated = true; break;} @@ -118,7 +119,7 @@ OAICategory::isSet() const { } bool -OAICategory::isValid() const { +PFXCategory::isValid() const { // only required properties are required for the object to be considered valid return true; } diff --git a/samples/client/petstore/cpp-qt5/client/OAICategory.h b/samples/client/petstore/cpp-qt5/client/PFXCategory.h similarity index 75% rename from samples/client/petstore/cpp-qt5/client/OAICategory.h rename to samples/client/petstore/cpp-qt5/client/PFXCategory.h index 8cfc76f4305..6bfe71d7a74 100644 --- a/samples/client/petstore/cpp-qt5/client/OAICategory.h +++ b/samples/client/petstore/cpp-qt5/client/PFXCategory.h @@ -11,30 +11,30 @@ */ /* - * OAICategory.h + * PFXCategory.h * * A category for a pet */ -#ifndef OAICategory_H -#define OAICategory_H +#ifndef PFXCategory_H +#define PFXCategory_H #include #include -#include "OAIObject.h" -#include "OAIEnum.h" +#include "PFXObject.h" +#include "PFXEnum.h" -namespace OpenAPI { +namespace test_namespace { -class OAICategory: public OAIObject { +class PFXCategory: public PFXObject { public: - OAICategory(); - OAICategory(QString json); - ~OAICategory() override; + PFXCategory(); + PFXCategory(QString json); + ~PFXCategory() override; QString asJson () const override; QJsonObject asJsonObject() const override; @@ -55,7 +55,7 @@ public: virtual bool isValid() const override; private: - void init(); + void initializeModel(); qint64 id; bool m_id_isSet; @@ -69,6 +69,6 @@ private: } -Q_DECLARE_METATYPE(OpenAPI::OAICategory) +Q_DECLARE_METATYPE(test_namespace::PFXCategory) -#endif // OAICategory_H +#endif // PFXCategory_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIEnum.h b/samples/client/petstore/cpp-qt5/client/PFXEnum.h similarity index 81% rename from samples/client/petstore/cpp-qt5/client/OAIEnum.h rename to samples/client/petstore/cpp-qt5/client/PFXEnum.h index 66625c43b63..9f3c9328255 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIEnum.h +++ b/samples/client/petstore/cpp-qt5/client/PFXEnum.h @@ -10,26 +10,26 @@ * Do not edit the class manually. */ -#ifndef OAI_ENUM_H -#define OAI_ENUM_H +#ifndef PFX_ENUM_H +#define PFX_ENUM_H #include #include #include -namespace OpenAPI { +namespace test_namespace { -class OAIEnum { +class PFXEnum { public: - OAIEnum() { + PFXEnum() { } - OAIEnum(QString jsonString) { + PFXEnum(QString jsonString) { fromJson(jsonString); } - virtual ~OAIEnum(){ + virtual ~PFXEnum(){ } @@ -62,6 +62,6 @@ private : } -Q_DECLARE_METATYPE(OpenAPI::OAIEnum) +Q_DECLARE_METATYPE(test_namespace::PFXEnum) -#endif // OAI_ENUM_H +#endif // PFX_ENUM_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIHelpers.cpp b/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp similarity index 92% rename from samples/client/petstore/cpp-qt5/client/OAIHelpers.cpp rename to samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp index e4138649b5a..15ed5d0c1bf 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHelpers.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp @@ -11,10 +11,10 @@ */ #include -#include "OAIHelpers.h" +#include "PFXHelpers.h" -namespace OpenAPI { +namespace test_namespace { QString @@ -65,18 +65,18 @@ toStringValue(const double &value){ } QString -toStringValue(const OAIObject &value){ +toStringValue(const PFXObject &value){ return value.asJson(); } QString -toStringValue(const OAIEnum &value){ +toStringValue(const PFXEnum &value){ return value.asJson(); } QString -toStringValue(const OAIHttpFileElement &value){ +toStringValue(const PFXHttpFileElement &value){ return value.asJson(); } @@ -127,17 +127,17 @@ toJsonValue(const double &value){ } QJsonValue -toJsonValue(const OAIObject &value){ +toJsonValue(const PFXObject &value){ return value.asJsonObject(); } QJsonValue -toJsonValue(const OAIEnum &value){ +toJsonValue(const PFXEnum &value){ return value.asJsonValue(); } QJsonValue -toJsonValue(const OAIHttpFileElement &value){ +toJsonValue(const PFXHttpFileElement &value){ return value.asJsonValue(); } @@ -231,13 +231,13 @@ fromStringValue(const QString &inStr, double &value){ } bool -fromStringValue(const QString &inStr, OAIEnum &value){ +fromStringValue(const QString &inStr, PFXEnum &value){ value.fromJson(inStr); return true; } bool -fromStringValue(const QString &inStr, OAIHttpFileElement &value){ +fromStringValue(const QString &inStr, PFXHttpFileElement &value){ return value.fromStringValue(inStr); } @@ -352,7 +352,7 @@ fromJsonValue(double &value, const QJsonValue &jval){ } bool -fromJsonValue(OAIObject &value, const QJsonValue &jval){ +fromJsonValue(PFXObject &value, const QJsonValue &jval){ bool ok = true; if(jval.isObject()){ value.fromJsonObject(jval.toObject()); @@ -364,13 +364,13 @@ fromJsonValue(OAIObject &value, const QJsonValue &jval){ } bool -fromJsonValue(OAIEnum &value, const QJsonValue &jval){ +fromJsonValue(PFXEnum &value, const QJsonValue &jval){ value.fromJsonValue(jval); return true; } bool -fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval){ +fromJsonValue(PFXHttpFileElement &value, const QJsonValue &jval){ return value.fromJsonValue(jval); } diff --git a/samples/client/petstore/cpp-qt5/client/OAIHelpers.h b/samples/client/petstore/cpp-qt5/client/PFXHelpers.h similarity index 76% rename from samples/client/petstore/cpp-qt5/client/OAIHelpers.h rename to samples/client/petstore/cpp-qt5/client/PFXHelpers.h index a2992183298..13b15dabdb2 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHelpers.h +++ b/samples/client/petstore/cpp-qt5/client/PFXHelpers.h @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -#ifndef OAI_HELPERS_H -#define OAI_HELPERS_H +#ifndef PFX_HELPERS_H +#define PFX_HELPERS_H #include #include @@ -23,12 +23,33 @@ #include #include -#include "OAIObject.h" -#include "OAIEnum.h" -#include "OAIHttpFileElement.h" +#include "PFXObject.h" +#include "PFXEnum.h" +#include "PFXHttpFileElement.h" -namespace OpenAPI { +namespace test_namespace { + template QString + toStringValue(const QList &val); + + template + bool fromStringValue(const QList &inStr, QList &val); + + template + bool fromStringValue(const QMap &inStr, QMap &val); + + template + QJsonValue toJsonValue(const QList &val); + + template + QJsonValue toJsonValue(const QMap &val); + + template + bool fromJsonValue(QList &val, const QJsonValue &jval); + + template + bool fromJsonValue(QMap &val, const QJsonValue &jval); + QString toStringValue(const QString &value); QString toStringValue(const QDateTime &value); QString toStringValue(const QByteArray &value); @@ -38,9 +59,9 @@ namespace OpenAPI { QString toStringValue(const bool &value); QString toStringValue(const float &value); QString toStringValue(const double &value); - QString toStringValue(const OAIObject &value); - QString toStringValue(const OAIEnum &value); - QString toStringValue(const OAIHttpFileElement &value); + QString toStringValue(const PFXObject &value); + QString toStringValue(const PFXEnum &value); + QString toStringValue(const PFXHttpFileElement &value); template QString toStringValue(const QList &val) { @@ -63,9 +84,9 @@ namespace OpenAPI { QJsonValue toJsonValue(const bool &value); QJsonValue toJsonValue(const float &value); QJsonValue toJsonValue(const double &value); - QJsonValue toJsonValue(const OAIObject &value); - QJsonValue toJsonValue(const OAIEnum &value); - QJsonValue toJsonValue(const OAIHttpFileElement &value); + QJsonValue toJsonValue(const PFXObject &value); + QJsonValue toJsonValue(const PFXEnum &value); + QJsonValue toJsonValue(const PFXHttpFileElement &value); template QJsonValue toJsonValue(const QList &val) { @@ -94,9 +115,9 @@ namespace OpenAPI { bool fromStringValue(const QString &inStr, bool &value); bool fromStringValue(const QString &inStr, float &value); bool fromStringValue(const QString &inStr, double &value); - bool fromStringValue(const QString &inStr, OAIObject &value); - bool fromStringValue(const QString &inStr, OAIEnum &value); - bool fromStringValue(const QString &inStr, OAIHttpFileElement &value); + bool fromStringValue(const QString &inStr, PFXObject &value); + bool fromStringValue(const QString &inStr, PFXEnum &value); + bool fromStringValue(const QString &inStr, PFXHttpFileElement &value); template bool fromStringValue(const QList &inStr, QList &val) { @@ -129,15 +150,15 @@ namespace OpenAPI { bool fromJsonValue(bool &value, const QJsonValue &jval); bool fromJsonValue(float &value, const QJsonValue &jval); bool fromJsonValue(double &value, const QJsonValue &jval); - bool fromJsonValue(OAIObject &value, const QJsonValue &jval); - bool fromJsonValue(OAIEnum &value, const QJsonValue &jval); - bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval); + bool fromJsonValue(PFXObject &value, const QJsonValue &jval); + bool fromJsonValue(PFXEnum &value, const QJsonValue &jval); + bool fromJsonValue(PFXHttpFileElement &value, const QJsonValue &jval); template bool fromJsonValue(QList &val, const QJsonValue &jval) { bool ok = true; if(jval.isArray()){ - for(const auto& jitem : jval.toArray()){ + for(const auto jitem : jval.toArray()){ T item; ok &= fromJsonValue(item, jitem); val.push_back(item); @@ -168,4 +189,4 @@ namespace OpenAPI { } -#endif // OAI_HELPERS_H +#endif // PFX_HELPERS_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIHttpFileElement.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.cpp similarity index 81% rename from samples/client/petstore/cpp-qt5/client/OAIHttpFileElement.cpp rename to samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.cpp index ef627144b1e..c2616877958 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHttpFileElement.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.cpp @@ -16,37 +16,37 @@ #include #include -#include "OAIHttpFileElement.h" +#include "PFXHttpFileElement.h" -namespace OpenAPI { +namespace test_namespace { void -OAIHttpFileElement::setMimeType(const QString &mime){ +PFXHttpFileElement::setMimeType(const QString &mime){ mime_type = mime; } void -OAIHttpFileElement::setFileName(const QString &name){ +PFXHttpFileElement::setFileName(const QString &name){ local_filename = name; } void -OAIHttpFileElement::setVariableName(const QString &name){ +PFXHttpFileElement::setVariableName(const QString &name){ variable_name = name; } void -OAIHttpFileElement::setRequestFileName(const QString &name){ +PFXHttpFileElement::setRequestFileName(const QString &name){ request_filename = name; } bool -OAIHttpFileElement::isSet() const { +PFXHttpFileElement::isSet() const { return !local_filename.isEmpty() || !request_filename.isEmpty(); } QString -OAIHttpFileElement::asJson() const{ +PFXHttpFileElement::asJson() const{ QFile file(local_filename); QByteArray bArray; bool result = false; @@ -62,7 +62,7 @@ OAIHttpFileElement::asJson() const{ } QJsonValue -OAIHttpFileElement::asJsonValue() const{ +PFXHttpFileElement::asJsonValue() const{ QFile file(local_filename); QByteArray bArray; bool result = false; @@ -78,7 +78,7 @@ OAIHttpFileElement::asJsonValue() const{ } bool -OAIHttpFileElement::fromStringValue(const QString &instr){ +PFXHttpFileElement::fromStringValue(const QString &instr){ QFile file(local_filename); bool result = false; if(file.exists()) { @@ -94,7 +94,7 @@ OAIHttpFileElement::fromStringValue(const QString &instr){ } bool -OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) { +PFXHttpFileElement::fromJsonValue(const QJsonValue &jval) { QFile file(local_filename); bool result = false; if(file.exists()) { @@ -110,7 +110,7 @@ OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) { } QByteArray -OAIHttpFileElement::asByteArray() const { +PFXHttpFileElement::asByteArray() const { QFile file(local_filename); QByteArray bArray; bool result = false; @@ -126,7 +126,7 @@ OAIHttpFileElement::asByteArray() const { } bool -OAIHttpFileElement::fromByteArray(const QByteArray& bytes){ +PFXHttpFileElement::fromByteArray(const QByteArray& bytes){ QFile file(local_filename); bool result = false; if(file.exists()){ @@ -142,7 +142,7 @@ OAIHttpFileElement::fromByteArray(const QByteArray& bytes){ } bool -OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ +PFXHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ setMimeType(mime); setFileName(localFName); setVariableName(varName); @@ -151,7 +151,7 @@ OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName } QByteArray -OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ +PFXHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ setMimeType(mime); setFileName(localFName); setVariableName(varName); diff --git a/samples/client/petstore/cpp-qt5/client/OAIHttpFileElement.h b/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.h similarity index 86% rename from samples/client/petstore/cpp-qt5/client/OAIHttpFileElement.h rename to samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.h index b5d189b3440..af819aff761 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHttpFileElement.h +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.h @@ -10,17 +10,17 @@ * Do not edit the class manually. */ -#ifndef OAI_HTTP_FILE_ELEMENT_H -#define OAI_HTTP_FILE_ELEMENT_H +#ifndef PFX_HTTP_FILE_ELEMENT_H +#define PFX_HTTP_FILE_ELEMENT_H #include #include #include -namespace OpenAPI { +namespace test_namespace { -class OAIHttpFileElement { +class PFXHttpFileElement { public: QString variable_name; @@ -44,6 +44,6 @@ public: } -Q_DECLARE_METATYPE(OpenAPI::OAIHttpFileElement) +Q_DECLARE_METATYPE(test_namespace::PFXHttpFileElement) -#endif // OAI_HTTP_FILE_ELEMENT_H +#endif // PFX_HTTP_FILE_ELEMENT_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp similarity index 86% rename from samples/client/petstore/cpp-qt5/client/OAIHttpRequest.cpp rename to samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp index ef06abdf289..951b9b911f0 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp @@ -19,34 +19,35 @@ #include #include #include +#include -#include "OAIHttpRequest.h" +#include "PFXHttpRequest.h" -namespace OpenAPI { +namespace test_namespace { -OAIHttpRequestInput::OAIHttpRequestInput() { +PFXHttpRequestInput::PFXHttpRequestInput() { initialize(); } -OAIHttpRequestInput::OAIHttpRequestInput(QString v_url_str, QString v_http_method) { +PFXHttpRequestInput::PFXHttpRequestInput(QString v_url_str, QString v_http_method) { initialize(); url_str = v_url_str; http_method = v_http_method; } -void OAIHttpRequestInput::initialize() { +void PFXHttpRequestInput::initialize() { var_layout = NOT_SET; url_str = ""; http_method = "GET"; } -void OAIHttpRequestInput::add_var(QString key, QString value) { +void PFXHttpRequestInput::add_var(QString key, QString value) { vars[key] = value; } -void OAIHttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { - OAIHttpFileElement file; +void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { + PFXHttpFileElement file; file.variable_name = variable_name; file.local_filename = local_filename; file.request_filename = request_filename; @@ -55,24 +56,16 @@ void OAIHttpRequestInput::add_file(QString variable_name, QString local_filename } -OAIHttpRequestWorker::OAIHttpRequestWorker(QObject *parent) - : QObject(parent), manager(nullptr) +PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent) + : QObject(parent), manager(nullptr), _timeOut(0) { qsrand(QDateTime::currentDateTime().toTime_t()); - timeout = 0; - timer = new QTimer(); manager = new QNetworkAccessManager(this); workingDirectory = QDir::currentPath(); - connect(manager, &QNetworkAccessManager::finished, this, &OAIHttpRequestWorker::on_manager_finished); + connect(manager, &QNetworkAccessManager::finished, this, &PFXHttpRequestWorker::on_manager_finished); } -OAIHttpRequestWorker::~OAIHttpRequestWorker() { - if(timer != nullptr){ - if(timer->isActive()){ - timer->stop(); - } - timer->deleteLater(); - } +PFXHttpRequestWorker::~PFXHttpRequestWorker() { for (const auto & item: multiPartFields) { if(item != nullptr) { delete item; @@ -80,11 +73,11 @@ OAIHttpRequestWorker::~OAIHttpRequestWorker() { } } -QMap OAIHttpRequestWorker::getResponseHeaders() const { +QMap PFXHttpRequestWorker::getResponseHeaders() const { return headers; } -OAIHttpFileElement OAIHttpRequestWorker::getHttpFileElement(const QString &fieldname){ +PFXHttpFileElement PFXHttpRequestWorker::getHttpFileElement(const QString &fieldname){ if(!files.isEmpty()){ if(fieldname.isEmpty()){ return files.first(); @@ -92,10 +85,10 @@ OAIHttpFileElement OAIHttpRequestWorker::getHttpFileElement(const QString &field return files[fieldname]; } } - return OAIHttpFileElement(); + return PFXHttpFileElement(); } -QByteArray *OAIHttpRequestWorker::getMultiPartField(const QString &fieldname){ +QByteArray *PFXHttpRequestWorker::getMultiPartField(const QString &fieldname){ if(!multiPartFields.isEmpty()){ if(fieldname.isEmpty()){ return multiPartFields.first(); @@ -106,18 +99,18 @@ QByteArray *OAIHttpRequestWorker::getMultiPartField(const QString &fieldname){ return nullptr; } -void OAIHttpRequestWorker::setTimeOut(int tout){ - timeout = tout; +void PFXHttpRequestWorker::setTimeOut(int timeOut){ + _timeOut = timeOut; } -void OAIHttpRequestWorker::setWorkingDirectory(const QString &path){ +void PFXHttpRequestWorker::setWorkingDirectory(const QString &path){ if(!path.isEmpty()){ workingDirectory = path; } } -QString OAIHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { +QString PFXHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; QString result = ""; @@ -165,7 +158,7 @@ QString OAIHttpRequestWorker::http_attribute_encode(QString attribute_name, QStr return QString("%1=\"%2\"; %1*=utf-8''%3").arg(attribute_name, result, result_utf8); } -void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) { +void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { // reset variables QNetworkReply* reply = nullptr; @@ -245,7 +238,7 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) { } // add files - for (QList::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { + for (QList::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { QFileInfo fi(file_info->local_filename); // ensure necessary variables are available @@ -317,8 +310,8 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) { // prepare connection QNetworkRequest request = QNetworkRequest(QUrl(input->url_str)); - if (OAIHttpRequestWorker::sslDefaultConfiguration != nullptr) { - request.setSslConfiguration(*OAIHttpRequestWorker::sslDefaultConfiguration); + if (PFXHttpRequestWorker::sslDefaultConfiguration != nullptr) { + request.setSslConfiguration(*PFXHttpRequestWorker::sslDefaultConfiguration); } request.setRawHeader("User-Agent", "OpenAPI-Generator/1.0.0/cpp-qt5"); foreach(QString key, input->headers.keys()) { @@ -367,15 +360,12 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) { buffer->setParent(reply); #endif } - if(timeout > 0){ - timer->setSingleShot(true); - timer->setInterval(timeout); - connect(timer, &QTimer::timeout, this, [=](){ on_manager_timeout(reply); }); - timer->start(); + if(_timeOut > 0){ + QTimer::singleShot(_timeOut, [=](){ on_manager_timeout(reply); }); } } -void OAIHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { +void PFXHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); response = reply->readAll(); error_str = reply->errorString(); @@ -389,7 +379,7 @@ void OAIHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { emit on_execution_finished(this); } -void OAIHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { +void PFXHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { error_type = QNetworkReply::TimeoutError; response = ""; error_str = "Timed out waiting for response"; @@ -399,7 +389,7 @@ void OAIHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { emit on_execution_finished(this); } -void OAIHttpRequestWorker::process_form_response() { +void PFXHttpRequestWorker::process_form_response() { if(getResponseHeaders().contains(QString("Content-Disposition")) ) { auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts); auto contentType = getResponseHeaders().contains(QString("Content-Type")) ? getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts).first() : QString(); @@ -411,7 +401,7 @@ void OAIHttpRequestWorker::process_form_response() { break; } } - OAIHttpFileElement felement; + PFXHttpFileElement felement; felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); files.insert(filename, felement); } @@ -427,7 +417,7 @@ void OAIHttpRequestWorker::process_form_response() { } } -QSslConfiguration* OAIHttpRequestWorker::sslDefaultConfiguration; +QSslConfiguration* PFXHttpRequestWorker::sslDefaultConfiguration; } diff --git a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.h b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h similarity index 68% rename from samples/client/petstore/cpp-qt5/client/OAIHttpRequest.h rename to samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h index 021f05d6d89..3ca8e2f8c72 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.h +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h @@ -16,37 +16,35 @@ * **/ -#ifndef OAI_HTTPREQUESTWORKER_H -#define OAI_HTTPREQUESTWORKER_H +#ifndef PFX_HTTPREQUESTWORKER_H +#define PFX_HTTPREQUESTWORKER_H #include #include -#include #include #include #include +#include "PFXHttpFileElement.h" -#include "OAIHttpFileElement.h" +namespace test_namespace { -namespace OpenAPI { - -enum OAIHttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; +enum PFXHttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; -class OAIHttpRequestInput { +class PFXHttpRequestInput { public: QString url_str; QString http_method; - OAIHttpRequestVarLayout var_layout; + PFXHttpRequestVarLayout var_layout; QMap vars; QMap headers; - QList files; + QList files; QByteArray request_body; - OAIHttpRequestInput(); - OAIHttpRequestInput(QString v_url_str, QString v_http_method); + PFXHttpRequestInput(); + PFXHttpRequestInput(QString v_url_str, QString v_http_method); void initialize(); void add_var(QString key, QString value); void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type); @@ -54,35 +52,34 @@ public: }; -class OAIHttpRequestWorker : public QObject { +class PFXHttpRequestWorker : public QObject { Q_OBJECT public: QByteArray response; QNetworkReply::NetworkError error_type; QString error_str; - QTimer *timer; - explicit OAIHttpRequestWorker(QObject *parent = nullptr); - virtual ~OAIHttpRequestWorker(); + explicit PFXHttpRequestWorker(QObject *parent = nullptr); + virtual ~PFXHttpRequestWorker(); QMap getResponseHeaders() const; QString http_attribute_encode(QString attribute_name, QString input); - void execute(OAIHttpRequestInput *input); + void execute(PFXHttpRequestInput *input); static QSslConfiguration* sslDefaultConfiguration; void setTimeOut(int tout); void setWorkingDirectory(const QString &path); - OAIHttpFileElement getHttpFileElement(const QString &fieldname = QString()); + PFXHttpFileElement getHttpFileElement(const QString &fieldname = QString()); QByteArray* getMultiPartField(const QString &fieldname = QString()); signals: - void on_execution_finished(OAIHttpRequestWorker *worker); + void on_execution_finished(PFXHttpRequestWorker *worker); private: QNetworkAccessManager *manager; QMap headers; - QMap files; + QMap files; QMap multiPartFields; QString workingDirectory; - int timeout; + int _timeOut; void on_manager_timeout(QNetworkReply *reply); void process_form_response(); private slots: @@ -91,4 +88,4 @@ private slots: } -#endif // OAI_HTTPREQUESTWORKER_H +#endif // PFX_HTTPREQUESTWORKER_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIObject.h b/samples/client/petstore/cpp-qt5/client/PFXObject.h similarity index 82% rename from samples/client/petstore/cpp-qt5/client/OAIObject.h rename to samples/client/petstore/cpp-qt5/client/PFXObject.h index 83757b56717..fb6004bbbc3 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIObject.h +++ b/samples/client/petstore/cpp-qt5/client/PFXObject.h @@ -10,26 +10,26 @@ * Do not edit the class manually. */ -#ifndef OAI_OBJECT_H -#define OAI_OBJECT_H +#ifndef PFX_OBJECT_H +#define PFX_OBJECT_H #include #include #include -namespace OpenAPI { +namespace test_namespace { -class OAIObject { +class PFXObject { public: - OAIObject() { + PFXObject() { } - OAIObject(QString jsonString) { + PFXObject(QString jsonString) { fromJson(jsonString); } - virtual ~OAIObject(){ + virtual ~PFXObject(){ } @@ -64,6 +64,6 @@ private : } -Q_DECLARE_METATYPE(OpenAPI::OAIObject) +Q_DECLARE_METATYPE(test_namespace::PFXObject) -#endif // OAI_OBJECT_H +#endif // PFX_OBJECT_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIOrder.cpp b/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp similarity index 53% rename from samples/client/petstore/cpp-qt5/client/OAIOrder.cpp rename to samples/client/petstore/cpp-qt5/client/PFXOrder.cpp index a6f0fb92d97..5887591617c 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIOrder.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp @@ -11,32 +11,32 @@ */ -#include "OAIOrder.h" +#include "PFXOrder.h" #include #include #include #include -#include "OAIHelpers.h" +#include "PFXHelpers.h" -namespace OpenAPI { +namespace test_namespace { -OAIOrder::OAIOrder(QString json) { - this->init(); +PFXOrder::PFXOrder(QString json) { + this->initializeModel(); this->fromJson(json); } -OAIOrder::OAIOrder() { - this->init(); +PFXOrder::PFXOrder() { + this->initializeModel(); } -OAIOrder::~OAIOrder() { +PFXOrder::~PFXOrder() { } void -OAIOrder::init() { +PFXOrder::initializeModel() { m_id_isSet = false; m_id_isValid = false; @@ -55,10 +55,11 @@ OAIOrder::init() { m_complete_isSet = false; m_complete_isValid = false; - } + +} void -OAIOrder::fromJson(QString jsonString) { +PFXOrder::fromJson(QString jsonString) { QByteArray array (jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -66,30 +67,30 @@ OAIOrder::fromJson(QString jsonString) { } void -OAIOrder::fromJsonObject(QJsonObject json) { +PFXOrder::fromJsonObject(QJsonObject json) { - m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_pet_id_isValid = ::test_namespace::fromJsonValue(pet_id, json[QString("petId")]); + m_pet_id_isSet = !json[QString("petId")].isNull() && m_pet_id_isValid; - m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]); + m_quantity_isValid = ::test_namespace::fromJsonValue(quantity, json[QString("quantity")]); + m_quantity_isSet = !json[QString("quantity")].isNull() && m_quantity_isValid; + m_ship_date_isValid = ::test_namespace::fromJsonValue(ship_date, json[QString("shipDate")]); + m_ship_date_isSet = !json[QString("shipDate")].isNull() && m_ship_date_isValid; - m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]); - - - m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]); - - - m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); - - - m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]); + m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]); + m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; + m_complete_isValid = ::test_namespace::fromJsonValue(complete, json[QString("complete")]); + m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid; } QString -OAIOrder::asJson () const { +PFXOrder::asJson () const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); @@ -97,97 +98,97 @@ OAIOrder::asJson () const { } QJsonObject -OAIOrder::asJsonObject() const { +PFXOrder::asJsonObject() const { QJsonObject obj; if(m_id_isSet){ - obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); } if(m_pet_id_isSet){ - obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id)); + obj.insert(QString("petId"), ::test_namespace::toJsonValue(pet_id)); } if(m_quantity_isSet){ - obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity)); + obj.insert(QString("quantity"), ::test_namespace::toJsonValue(quantity)); } if(m_ship_date_isSet){ - obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date)); + obj.insert(QString("shipDate"), ::test_namespace::toJsonValue(ship_date)); } if(m_status_isSet){ - obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); + obj.insert(QString("status"), ::test_namespace::toJsonValue(status)); } if(m_complete_isSet){ - obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete)); + obj.insert(QString("complete"), ::test_namespace::toJsonValue(complete)); } return obj; } qint64 -OAIOrder::getId() const { +PFXOrder::getId() const { return id; } void -OAIOrder::setId(const qint64 &id) { +PFXOrder::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } qint64 -OAIOrder::getPetId() const { +PFXOrder::getPetId() const { return pet_id; } void -OAIOrder::setPetId(const qint64 &pet_id) { +PFXOrder::setPetId(const qint64 &pet_id) { this->pet_id = pet_id; this->m_pet_id_isSet = true; } qint32 -OAIOrder::getQuantity() const { +PFXOrder::getQuantity() const { return quantity; } void -OAIOrder::setQuantity(const qint32 &quantity) { +PFXOrder::setQuantity(const qint32 &quantity) { this->quantity = quantity; this->m_quantity_isSet = true; } QDateTime -OAIOrder::getShipDate() const { +PFXOrder::getShipDate() const { return ship_date; } void -OAIOrder::setShipDate(const QDateTime &ship_date) { +PFXOrder::setShipDate(const QDateTime &ship_date) { this->ship_date = ship_date; this->m_ship_date_isSet = true; } QString -OAIOrder::getStatus() const { +PFXOrder::getStatus() const { return status; } void -OAIOrder::setStatus(const QString &status) { +PFXOrder::setStatus(const QString &status) { this->status = status; this->m_status_isSet = true; } bool -OAIOrder::isComplete() const { +PFXOrder::isComplete() const { return complete; } void -OAIOrder::setComplete(const bool &complete) { +PFXOrder::setComplete(const bool &complete) { this->complete = complete; this->m_complete_isSet = true; } bool -OAIOrder::isSet() const { +PFXOrder::isSet() const { bool isObjectUpdated = false; do{ if(m_id_isSet){ isObjectUpdated = true; break;} @@ -206,7 +207,7 @@ OAIOrder::isSet() const { } bool -OAIOrder::isValid() const { +PFXOrder::isValid() const { // only required properties are required for the object to be considered valid return true; } diff --git a/samples/client/petstore/cpp-qt5/client/OAIOrder.h b/samples/client/petstore/cpp-qt5/client/PFXOrder.h similarity index 84% rename from samples/client/petstore/cpp-qt5/client/OAIOrder.h rename to samples/client/petstore/cpp-qt5/client/PFXOrder.h index 7acf2ab0a32..34fc7eb1f55 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIOrder.h +++ b/samples/client/petstore/cpp-qt5/client/PFXOrder.h @@ -11,13 +11,13 @@ */ /* - * OAIOrder.h + * PFXOrder.h * * An order for a pets from the pet store */ -#ifndef OAIOrder_H -#define OAIOrder_H +#ifndef PFXOrder_H +#define PFXOrder_H #include @@ -25,17 +25,17 @@ #include #include -#include "OAIObject.h" -#include "OAIEnum.h" +#include "PFXObject.h" +#include "PFXEnum.h" -namespace OpenAPI { +namespace test_namespace { -class OAIOrder: public OAIObject { +class PFXOrder: public PFXObject { public: - OAIOrder(); - OAIOrder(QString json); - ~OAIOrder() override; + PFXOrder(); + PFXOrder(QString json); + ~PFXOrder() override; QString asJson () const override; QJsonObject asJsonObject() const override; @@ -72,7 +72,7 @@ public: virtual bool isValid() const override; private: - void init(); + void initializeModel(); qint64 id; bool m_id_isSet; @@ -102,6 +102,6 @@ private: } -Q_DECLARE_METATYPE(OpenAPI::OAIOrder) +Q_DECLARE_METATYPE(test_namespace::PFXOrder) -#endif // OAIOrder_H +#endif // PFXOrder_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIPet.cpp b/samples/client/petstore/cpp-qt5/client/PFXPet.cpp similarity index 54% rename from samples/client/petstore/cpp-qt5/client/OAIPet.cpp rename to samples/client/petstore/cpp-qt5/client/PFXPet.cpp index 8a6cfec0319..955fc9166ac 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPet.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXPet.cpp @@ -11,32 +11,32 @@ */ -#include "OAIPet.h" +#include "PFXPet.h" #include #include #include #include -#include "OAIHelpers.h" +#include "PFXHelpers.h" -namespace OpenAPI { +namespace test_namespace { -OAIPet::OAIPet(QString json) { - this->init(); +PFXPet::PFXPet(QString json) { + this->initializeModel(); this->fromJson(json); } -OAIPet::OAIPet() { - this->init(); +PFXPet::PFXPet() { + this->initializeModel(); } -OAIPet::~OAIPet() { +PFXPet::~PFXPet() { } void -OAIPet::init() { +PFXPet::initializeModel() { m_id_isSet = false; m_id_isValid = false; @@ -55,10 +55,11 @@ OAIPet::init() { m_status_isSet = false; m_status_isValid = false; - } + +} void -OAIPet::fromJson(QString jsonString) { +PFXPet::fromJson(QString jsonString) { QByteArray array (jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -66,30 +67,30 @@ OAIPet::fromJson(QString jsonString) { } void -OAIPet::fromJsonObject(QJsonObject json) { +PFXPet::fromJsonObject(QJsonObject json) { - m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_category_isValid = ::test_namespace::fromJsonValue(category, json[QString("category")]); + m_category_isSet = !json[QString("category")].isNull() && m_category_isValid; - m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]); + m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); + m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; + m_photo_urls_isValid = ::test_namespace::fromJsonValue(photo_urls, json[QString("photoUrls")]); + m_photo_urls_isSet = !json[QString("photoUrls")].isNull() && m_photo_urls_isValid; - m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); - - - - m_photo_urls_isValid = ::OpenAPI::fromJsonValue(photo_urls, json[QString("photoUrls")]); - - - m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]); - - m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); + m_tags_isValid = ::test_namespace::fromJsonValue(tags, json[QString("tags")]); + m_tags_isSet = !json[QString("tags")].isNull() && m_tags_isValid; + m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]); + m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; } QString -OAIPet::asJson () const { +PFXPet::asJson () const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); @@ -97,99 +98,99 @@ OAIPet::asJson () const { } QJsonObject -OAIPet::asJsonObject() const { +PFXPet::asJsonObject() const { QJsonObject obj; if(m_id_isSet){ - obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); } if(category.isSet()){ - obj.insert(QString("category"), ::OpenAPI::toJsonValue(category)); + obj.insert(QString("category"), ::test_namespace::toJsonValue(category)); } if(m_name_isSet){ - obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); } if(photo_urls.size() > 0){ - obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls)); + obj.insert(QString("photoUrls"), ::test_namespace::toJsonValue(photo_urls)); } if(tags.size() > 0){ - obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags)); + obj.insert(QString("tags"), ::test_namespace::toJsonValue(tags)); } if(m_status_isSet){ - obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); + obj.insert(QString("status"), ::test_namespace::toJsonValue(status)); } return obj; } qint64 -OAIPet::getId() const { +PFXPet::getId() const { return id; } void -OAIPet::setId(const qint64 &id) { +PFXPet::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } -OAICategory -OAIPet::getCategory() const { +PFXCategory +PFXPet::getCategory() const { return category; } void -OAIPet::setCategory(const OAICategory &category) { +PFXPet::setCategory(const PFXCategory &category) { this->category = category; this->m_category_isSet = true; } QString -OAIPet::getName() const { +PFXPet::getName() const { return name; } void -OAIPet::setName(const QString &name) { +PFXPet::setName(const QString &name) { this->name = name; this->m_name_isSet = true; } QList -OAIPet::getPhotoUrls() const { +PFXPet::getPhotoUrls() const { return photo_urls; } void -OAIPet::setPhotoUrls(const QList &photo_urls) { +PFXPet::setPhotoUrls(const QList &photo_urls) { this->photo_urls = photo_urls; this->m_photo_urls_isSet = true; } -QList -OAIPet::getTags() const { +QList +PFXPet::getTags() const { return tags; } void -OAIPet::setTags(const QList &tags) { +PFXPet::setTags(const QList &tags) { this->tags = tags; this->m_tags_isSet = true; } QString -OAIPet::getStatus() const { +PFXPet::getStatus() const { return status; } void -OAIPet::setStatus(const QString &status) { +PFXPet::setStatus(const QString &status) { this->status = status; this->m_status_isSet = true; } bool -OAIPet::isSet() const { +PFXPet::isSet() const { bool isObjectUpdated = false; do{ if(m_id_isSet){ isObjectUpdated = true; break;} @@ -208,7 +209,7 @@ OAIPet::isSet() const { } bool -OAIPet::isValid() const { +PFXPet::isValid() const { // only required properties are required for the object to be considered valid return m_name_isValid && m_photo_urls_isValid && true; } diff --git a/samples/client/petstore/cpp-qt5/client/OAIPet.h b/samples/client/petstore/cpp-qt5/client/PFXPet.h similarity index 73% rename from samples/client/petstore/cpp-qt5/client/OAIPet.h rename to samples/client/petstore/cpp-qt5/client/PFXPet.h index c2577bfc5a2..ad5d035e995 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPet.h +++ b/samples/client/petstore/cpp-qt5/client/PFXPet.h @@ -11,33 +11,33 @@ */ /* - * OAIPet.h + * PFXPet.h * * A pet for sale in the pet store */ -#ifndef OAIPet_H -#define OAIPet_H +#ifndef PFXPet_H +#define PFXPet_H #include -#include "OAICategory.h" -#include "OAITag.h" +#include "PFXCategory.h" +#include "PFXTag.h" #include #include -#include "OAIObject.h" -#include "OAIEnum.h" +#include "PFXObject.h" +#include "PFXEnum.h" -namespace OpenAPI { +namespace test_namespace { -class OAIPet: public OAIObject { +class PFXPet: public PFXObject { public: - OAIPet(); - OAIPet(QString json); - ~OAIPet() override; + PFXPet(); + PFXPet(QString json); + ~PFXPet() override; QString asJson () const override; QJsonObject asJsonObject() const override; @@ -49,8 +49,8 @@ public: void setId(const qint64 &id); - OAICategory getCategory() const; - void setCategory(const OAICategory &category); + PFXCategory getCategory() const; + void setCategory(const PFXCategory &category); QString getName() const; @@ -61,8 +61,8 @@ public: void setPhotoUrls(const QList &photo_urls); - QList getTags() const; - void setTags(const QList &tags); + QList getTags() const; + void setTags(const QList &tags); QString getStatus() const; @@ -74,13 +74,13 @@ public: virtual bool isValid() const override; private: - void init(); + void initializeModel(); qint64 id; bool m_id_isSet; bool m_id_isValid; - OAICategory category; + PFXCategory category; bool m_category_isSet; bool m_category_isValid; @@ -92,7 +92,7 @@ private: bool m_photo_urls_isSet; bool m_photo_urls_isValid; - QList tags; + QList tags; bool m_tags_isSet; bool m_tags_isValid; @@ -104,6 +104,6 @@ private: } -Q_DECLARE_METATYPE(OpenAPI::OAIPet) +Q_DECLARE_METATYPE(test_namespace::PFXPet) -#endif // OAIPet_H +#endif // PFXPet_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp similarity index 61% rename from samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp rename to samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp index 8cb7352341d..0c03c3cd31c 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp @@ -10,60 +10,66 @@ * Do not edit the class manually. */ -#include "OAIPetApi.h" -#include "OAIHelpers.h" +#include "PFXPetApi.h" +#include "PFXHelpers.h" #include #include -namespace OpenAPI { - -OAIPetApi::OAIPetApi() : basePath("/v2"), - host("petstore.swagger.io"), - timeout(0){ +namespace test_namespace { +PFXPetApi::PFXPetApi(const QString &scheme, const QString &host, int port, const QString& basePath, const int timeOut) : + _scheme(scheme), + _host(host), + _port(port), + _basePath(basePath), + _timeOut(timeOut) { } -OAIPetApi::~OAIPetApi() { - +PFXPetApi::~PFXPetApi() { } -OAIPetApi::OAIPetApi(const QString& host, const QString& basePath, const int tout) { - this->host = host; - this->basePath = basePath; - this->timeout = tout; +void PFXPetApi::setScheme(const QString& scheme){ + _scheme = scheme; } -void OAIPetApi::setBasePath(const QString& basePath){ - this->basePath = basePath; +void PFXPetApi::setHost(const QString& host){ + _host = host; } -void OAIPetApi::setHost(const QString& host){ - this->host = host; +void PFXPetApi::setPort(int port){ + _port = port; } -void OAIPetApi::setApiTimeOutMs(const int tout){ - timeout = tout; +void PFXPetApi::setBasePath(const QString& basePath){ + _basePath = basePath; } -void OAIPetApi::setWorkingDirectory(const QString& path){ - workingDirectory = path; +void PFXPetApi::setTimeOut(const int timeOut){ + _timeOut = timeOut; } -void OAIPetApi::addHeaders(const QString& key, const QString& value){ +void PFXPetApi::setWorkingDirectory(const QString& path){ + _workingDirectory = path; +} + +void PFXPetApi::addHeaders(const QString& key, const QString& value){ defaultHeaders.insert(key, value); } - void -OAIPetApi::addPet(const OAIPet& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet"); +PFXPetApi::addPet(const PFXPet& body) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "POST"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -75,15 +81,15 @@ OAIPetApi::addPet(const OAIPet& body) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::addPetCallback); + &PFXPetApi::addPetCallback); worker->execute(&input); } void -OAIPetApi::addPetCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::addPetCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -106,17 +112,21 @@ OAIPetApi::addPetCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); +PFXPetApi::deletePet(const qint64& pet_id, const QString& api_key) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet/{petId}"); QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); + fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "DELETE"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "DELETE"); if (api_key != nullptr) { @@ -128,15 +138,15 @@ OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::deletePetCallback); + &PFXPetApi::deletePetCallback); worker->execute(&input); } void -OAIPetApi::deletePetCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::deletePetCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -159,9 +169,13 @@ OAIPetApi::deletePetCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::findPetsByStatus(const QList& status) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus"); +PFXPetApi::findPetsByStatus(const QList& status) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet/findByStatus"); if (status.size() > 0) { if (QString("csv").indexOf("multi") == 0) { @@ -170,7 +184,7 @@ OAIPetApi::findPetsByStatus(const QList& status) { fullPath.append("&"); else fullPath.append("?"); - fullPath.append("status=").append(::OpenAPI::toStringValue(t)); + fullPath.append("status=").append(::test_namespace::toStringValue(t)); } } else if (QString("csv").indexOf("ssv") == 0) { @@ -184,7 +198,7 @@ OAIPetApi::findPetsByStatus(const QList& status) { if (count > 0) { fullPath.append(" "); } - fullPath.append(::OpenAPI::toStringValue(t)); + fullPath.append(::test_namespace::toStringValue(t)); } } else if (QString("csv").indexOf("tsv") == 0) { @@ -198,15 +212,15 @@ OAIPetApi::findPetsByStatus(const QList& status) { if (count > 0) { fullPath.append("\t"); } - fullPath.append(::OpenAPI::toStringValue(t)); + fullPath.append(::test_namespace::toStringValue(t)); } } } - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -215,15 +229,15 @@ OAIPetApi::findPetsByStatus(const QList& status) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::findPetsByStatusCallback); + &PFXPetApi::findPetsByStatusCallback); worker->execute(&input); } void -OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -234,14 +248,14 @@ OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) { else { msg = "Error: " + worker->error_str; } - QList output; + QList output; QString json(worker->response); QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonArray jsonArray = doc.array(); foreach(QJsonValue obj, jsonArray) { - OAIPet val; - ::OpenAPI::fromJsonValue(val, obj); + PFXPet val; + ::test_namespace::fromJsonValue(val, obj); output.append(val); } worker->deleteLater(); @@ -256,9 +270,13 @@ OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::findPetsByTags(const QList& tags) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/findByTags"); +PFXPetApi::findPetsByTags(const QList& tags) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet/findByTags"); if (tags.size() > 0) { if (QString("csv").indexOf("multi") == 0) { @@ -267,7 +285,7 @@ OAIPetApi::findPetsByTags(const QList& tags) { fullPath.append("&"); else fullPath.append("?"); - fullPath.append("tags=").append(::OpenAPI::toStringValue(t)); + fullPath.append("tags=").append(::test_namespace::toStringValue(t)); } } else if (QString("csv").indexOf("ssv") == 0) { @@ -281,7 +299,7 @@ OAIPetApi::findPetsByTags(const QList& tags) { if (count > 0) { fullPath.append(" "); } - fullPath.append(::OpenAPI::toStringValue(t)); + fullPath.append(::test_namespace::toStringValue(t)); } } else if (QString("csv").indexOf("tsv") == 0) { @@ -295,15 +313,15 @@ OAIPetApi::findPetsByTags(const QList& tags) { if (count > 0) { fullPath.append("\t"); } - fullPath.append(::OpenAPI::toStringValue(t)); + fullPath.append(::test_namespace::toStringValue(t)); } } } - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -312,15 +330,15 @@ OAIPetApi::findPetsByTags(const QList& tags) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::findPetsByTagsCallback); + &PFXPetApi::findPetsByTagsCallback); worker->execute(&input); } void -OAIPetApi::findPetsByTagsCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -331,14 +349,14 @@ OAIPetApi::findPetsByTagsCallback(OAIHttpRequestWorker * worker) { else { msg = "Error: " + worker->error_str; } - QList output; + QList output; QString json(worker->response); QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonArray jsonArray = doc.array(); foreach(QJsonValue obj, jsonArray) { - OAIPet val; - ::OpenAPI::fromJsonValue(val, obj); + PFXPet val; + ::test_namespace::fromJsonValue(val, obj); output.append(val); } worker->deleteLater(); @@ -353,17 +371,21 @@ OAIPetApi::findPetsByTagsCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::getPetById(const qint64& pet_id) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); +PFXPetApi::getPetById(const qint64& pet_id) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet/{petId}"); QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); + fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -372,15 +394,15 @@ OAIPetApi::getPetById(const qint64& pet_id) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::getPetByIdCallback); + &PFXPetApi::getPetByIdCallback); worker->execute(&input); } void -OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::getPetByIdCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -391,7 +413,7 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) { else { msg = "Error: " + worker->error_str; } - OAIPet output(QString(worker->response)); + PFXPet output(QString(worker->response)); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { @@ -404,14 +426,18 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::updatePet(const OAIPet& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet"); +PFXPetApi::updatePet(const PFXPet& body) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "PUT"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); @@ -423,15 +449,15 @@ OAIPetApi::updatePet(const OAIPet& body) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::updatePetCallback); + &PFXPetApi::updatePetCallback); worker->execute(&input); } void -OAIPetApi::updatePetCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::updatePetCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -454,20 +480,24 @@ OAIPetApi::updatePetCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); +PFXPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet/{petId}"); QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); + fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "POST"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "POST"); - input.add_var("name", ::OpenAPI::toStringValue(name)); - input.add_var("status", ::OpenAPI::toStringValue(status)); + input.add_var("name", ::test_namespace::toStringValue(name)); + input.add_var("status", ::test_namespace::toStringValue(status)); foreach(QString key, this->defaultHeaders.keys()) { @@ -475,15 +505,15 @@ OAIPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QS } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::updatePetWithFormCallback); + &PFXPetApi::updatePetWithFormCallback); worker->execute(&input); } void -OAIPetApi::updatePetWithFormCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -506,19 +536,23 @@ OAIPetApi::updatePetWithFormCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpFileElement& file) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage"); +PFXPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata, const PFXHttpFileElement& file) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/pet/{petId}/uploadImage"); QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); + fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "POST"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "POST"); - input.add_var("additionalMetadata", ::OpenAPI::toStringValue(additional_metadata)); + input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata)); input.add_file("file", file.local_filename, file.request_filename, file.mime_type); @@ -527,15 +561,15 @@ OAIPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata, } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIPetApi::uploadFileCallback); + &PFXPetApi::uploadFileCallback); worker->execute(&input); } void -OAIPetApi::uploadFileCallback(OAIHttpRequestWorker * worker) { +PFXPetApi::uploadFileCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -546,7 +580,7 @@ OAIPetApi::uploadFileCallback(OAIHttpRequestWorker * worker) { else { msg = "Error: " + worker->error_str; } - OAIApiResponse output(QString(worker->response)); + PFXApiResponse output(QString(worker->response)); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h new file mode 100644 index 00000000000..67fc74d25a0 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef PFX_PFXPetApi_H +#define PFX_PFXPetApi_H + +#include "PFXHttpRequest.h" + +#include "PFXApiResponse.h" +#include "PFXHttpFileElement.h" +#include "PFXPet.h" +#include + +#include + +namespace test_namespace { + +class PFXPetApi: public QObject { + Q_OBJECT + +public: + PFXPetApi(const QString &scheme = "http", const QString &host = "petstore.swagger.io", int port = 0, const QString& basePath = "/v2", const int timeOut = 0); + ~PFXPetApi(); + + void setScheme(const QString &scheme); + void setHost(const QString &host); + void setPort(int port); + void setBasePath(const QString& basePath); + void setTimeOut(const int timeOut); + void setWorkingDirectory(const QString& path); + void addHeaders(const QString& key, const QString& value); + + void addPet(const PFXPet& body); + void deletePet(const qint64& pet_id, const QString& api_key); + void findPetsByStatus(const QList& status); + void findPetsByTags(const QList& tags); + void getPetById(const qint64& pet_id); + void updatePet(const PFXPet& body); + void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status); + void uploadFile(const qint64& pet_id, const QString& additional_metadata, const PFXHttpFileElement& file); + +private: + QString _scheme, _host, _basePath; + int _port, _timeOut; + QString _workingDirectory; + QMap defaultHeaders; + void addPetCallback (PFXHttpRequestWorker * worker); + void deletePetCallback (PFXHttpRequestWorker * worker); + void findPetsByStatusCallback (PFXHttpRequestWorker * worker); + void findPetsByTagsCallback (PFXHttpRequestWorker * worker); + void getPetByIdCallback (PFXHttpRequestWorker * worker); + void updatePetCallback (PFXHttpRequestWorker * worker); + void updatePetWithFormCallback (PFXHttpRequestWorker * worker); + void uploadFileCallback (PFXHttpRequestWorker * worker); + +signals: + void addPetSignal(); + void deletePetSignal(); + void findPetsByStatusSignal(QList summary); + void findPetsByTagsSignal(QList summary); + void getPetByIdSignal(PFXPet summary); + void updatePetSignal(); + void updatePetWithFormSignal(); + void uploadFileSignal(PFXApiResponse summary); + + void addPetSignalFull(PFXHttpRequestWorker* worker); + void deletePetSignalFull(PFXHttpRequestWorker* worker); + void findPetsByStatusSignalFull(PFXHttpRequestWorker* worker, QList summary); + void findPetsByTagsSignalFull(PFXHttpRequestWorker* worker, QList summary); + void getPetByIdSignalFull(PFXHttpRequestWorker* worker, PFXPet summary); + void updatePetSignalFull(PFXHttpRequestWorker* worker); + void updatePetWithFormSignalFull(PFXHttpRequestWorker* worker); + void uploadFileSignalFull(PFXHttpRequestWorker* worker, PFXApiResponse summary); + + void addPetSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void deletePetSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void findPetsByStatusSignalE(QList summary, QNetworkReply::NetworkError error_type, QString error_str); + void findPetsByTagsSignalE(QList summary, QNetworkReply::NetworkError error_type, QString error_str); + void getPetByIdSignalE(PFXPet summary, QNetworkReply::NetworkError error_type, QString error_str); + void updatePetSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void uploadFileSignalE(PFXApiResponse summary, QNetworkReply::NetworkError error_type, QString error_str); + + void addPetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void deletePetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void findPetsByStatusSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void findPetsByTagsSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void getPetByIdSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void updatePetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void updatePetWithFormSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void uploadFileSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + +}; + +} +#endif diff --git a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp similarity index 56% rename from samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp rename to samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp index eaff088e585..df62ceb15b1 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp @@ -10,63 +10,69 @@ * Do not edit the class manually. */ -#include "OAIStoreApi.h" -#include "OAIHelpers.h" +#include "PFXStoreApi.h" +#include "PFXHelpers.h" #include #include -namespace OpenAPI { - -OAIStoreApi::OAIStoreApi() : basePath("/v2"), - host("petstore.swagger.io"), - timeout(0){ +namespace test_namespace { +PFXStoreApi::PFXStoreApi(const QString &scheme, const QString &host, int port, const QString& basePath, const int timeOut) : + _scheme(scheme), + _host(host), + _port(port), + _basePath(basePath), + _timeOut(timeOut) { } -OAIStoreApi::~OAIStoreApi() { - +PFXStoreApi::~PFXStoreApi() { } -OAIStoreApi::OAIStoreApi(const QString& host, const QString& basePath, const int tout) { - this->host = host; - this->basePath = basePath; - this->timeout = tout; +void PFXStoreApi::setScheme(const QString& scheme){ + _scheme = scheme; } -void OAIStoreApi::setBasePath(const QString& basePath){ - this->basePath = basePath; +void PFXStoreApi::setHost(const QString& host){ + _host = host; } -void OAIStoreApi::setHost(const QString& host){ - this->host = host; +void PFXStoreApi::setPort(int port){ + _port = port; } -void OAIStoreApi::setApiTimeOutMs(const int tout){ - timeout = tout; +void PFXStoreApi::setBasePath(const QString& basePath){ + _basePath = basePath; } -void OAIStoreApi::setWorkingDirectory(const QString& path){ - workingDirectory = path; +void PFXStoreApi::setTimeOut(const int timeOut){ + _timeOut = timeOut; } -void OAIStoreApi::addHeaders(const QString& key, const QString& value){ +void PFXStoreApi::setWorkingDirectory(const QString& path){ + _workingDirectory = path; +} + +void PFXStoreApi::addHeaders(const QString& key, const QString& value){ defaultHeaders.insert(key, value); } - void -OAIStoreApi::deleteOrder(const QString& order_id) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); +PFXStoreApi::deleteOrder(const QString& order_id) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/store/order/{orderId}"); QString order_idPathParam("{"); order_idPathParam.append("orderId").append("}"); - fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id))); + fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "DELETE"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "DELETE"); @@ -75,15 +81,15 @@ OAIStoreApi::deleteOrder(const QString& order_id) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIStoreApi::deleteOrderCallback); + &PFXStoreApi::deleteOrderCallback); worker->execute(&input); } void -OAIStoreApi::deleteOrderCallback(OAIHttpRequestWorker * worker) { +PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -106,14 +112,18 @@ OAIStoreApi::deleteOrderCallback(OAIHttpRequestWorker * worker) { } void -OAIStoreApi::getInventory() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/inventory"); +PFXStoreApi::getInventory() { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/store/inventory"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -122,15 +132,15 @@ OAIStoreApi::getInventory() { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIStoreApi::getInventoryCallback); + &PFXStoreApi::getInventoryCallback); worker->execute(&input); } void -OAIStoreApi::getInventoryCallback(OAIHttpRequestWorker * worker) { +PFXStoreApi::getInventoryCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -148,7 +158,7 @@ OAIStoreApi::getInventoryCallback(OAIHttpRequestWorker * worker) { QJsonObject obj = doc.object(); foreach(QString key, obj.keys()) { qint32 val; - ::OpenAPI::fromJsonValue(val, obj[key]); + ::test_namespace::fromJsonValue(val, obj[key]); output.insert(key, val); } worker->deleteLater(); @@ -163,17 +173,21 @@ OAIStoreApi::getInventoryCallback(OAIHttpRequestWorker * worker) { } void -OAIStoreApi::getOrderById(const qint64& order_id) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); +PFXStoreApi::getOrderById(const qint64& order_id) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/store/order/{orderId}"); QString order_idPathParam("{"); order_idPathParam.append("orderId").append("}"); - fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id))); + fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -182,15 +196,15 @@ OAIStoreApi::getOrderById(const qint64& order_id) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIStoreApi::getOrderByIdCallback); + &PFXStoreApi::getOrderByIdCallback); worker->execute(&input); } void -OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) { +PFXStoreApi::getOrderByIdCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -201,7 +215,7 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) { else { msg = "Error: " + worker->error_str; } - OAIOrder output(QString(worker->response)); + PFXOrder output(QString(worker->response)); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { @@ -214,14 +228,18 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) { } void -OAIStoreApi::placeOrder(const OAIOrder& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/order"); +PFXStoreApi::placeOrder(const PFXOrder& body) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/store/order"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "POST"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -233,15 +251,15 @@ OAIStoreApi::placeOrder(const OAIOrder& body) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIStoreApi::placeOrderCallback); + &PFXStoreApi::placeOrderCallback); worker->execute(&input); } void -OAIStoreApi::placeOrderCallback(OAIHttpRequestWorker * worker) { +PFXStoreApi::placeOrderCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -252,7 +270,7 @@ OAIStoreApi::placeOrderCallback(OAIHttpRequestWorker * worker) { else { msg = "Error: " + worker->error_str; } - OAIOrder output(QString(worker->response)); + PFXOrder output(QString(worker->response)); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h new file mode 100644 index 00000000000..d292d819467 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef PFX_PFXStoreApi_H +#define PFX_PFXStoreApi_H + +#include "PFXHttpRequest.h" + +#include "PFXOrder.h" +#include +#include + +#include + +namespace test_namespace { + +class PFXStoreApi: public QObject { + Q_OBJECT + +public: + PFXStoreApi(const QString &scheme = "http", const QString &host = "petstore.swagger.io", int port = 0, const QString& basePath = "/v2", const int timeOut = 0); + ~PFXStoreApi(); + + void setScheme(const QString &scheme); + void setHost(const QString &host); + void setPort(int port); + void setBasePath(const QString& basePath); + void setTimeOut(const int timeOut); + void setWorkingDirectory(const QString& path); + void addHeaders(const QString& key, const QString& value); + + void deleteOrder(const QString& order_id); + void getInventory(); + void getOrderById(const qint64& order_id); + void placeOrder(const PFXOrder& body); + +private: + QString _scheme, _host, _basePath; + int _port, _timeOut; + QString _workingDirectory; + QMap defaultHeaders; + void deleteOrderCallback (PFXHttpRequestWorker * worker); + void getInventoryCallback (PFXHttpRequestWorker * worker); + void getOrderByIdCallback (PFXHttpRequestWorker * worker); + void placeOrderCallback (PFXHttpRequestWorker * worker); + +signals: + void deleteOrderSignal(); + void getInventorySignal(QMap summary); + void getOrderByIdSignal(PFXOrder summary); + void placeOrderSignal(PFXOrder summary); + + void deleteOrderSignalFull(PFXHttpRequestWorker* worker); + void getInventorySignalFull(PFXHttpRequestWorker* worker, QMap summary); + void getOrderByIdSignalFull(PFXHttpRequestWorker* worker, PFXOrder summary); + void placeOrderSignalFull(PFXHttpRequestWorker* worker, PFXOrder summary); + + void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void getInventorySignalE(QMap summary, QNetworkReply::NetworkError error_type, QString error_str); + void getOrderByIdSignalE(PFXOrder summary, QNetworkReply::NetworkError error_type, QString error_str); + void placeOrderSignalE(PFXOrder summary, QNetworkReply::NetworkError error_type, QString error_str); + + void deleteOrderSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void getInventorySignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void getOrderByIdSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void placeOrderSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + +}; + +} +#endif diff --git a/samples/client/petstore/cpp-qt5/client/OAITag.cpp b/samples/client/petstore/cpp-qt5/client/PFXTag.cpp similarity index 62% rename from samples/client/petstore/cpp-qt5/client/OAITag.cpp rename to samples/client/petstore/cpp-qt5/client/PFXTag.cpp index d986ce63b14..b4fa9007879 100644 --- a/samples/client/petstore/cpp-qt5/client/OAITag.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXTag.cpp @@ -11,42 +11,43 @@ */ -#include "OAITag.h" +#include "PFXTag.h" #include #include #include #include -#include "OAIHelpers.h" +#include "PFXHelpers.h" -namespace OpenAPI { +namespace test_namespace { -OAITag::OAITag(QString json) { - this->init(); +PFXTag::PFXTag(QString json) { + this->initializeModel(); this->fromJson(json); } -OAITag::OAITag() { - this->init(); +PFXTag::PFXTag() { + this->initializeModel(); } -OAITag::~OAITag() { +PFXTag::~PFXTag() { } void -OAITag::init() { +PFXTag::initializeModel() { m_id_isSet = false; m_id_isValid = false; m_name_isSet = false; m_name_isValid = false; - } + +} void -OAITag::fromJson(QString jsonString) { +PFXTag::fromJson(QString jsonString) { QByteArray array (jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -54,18 +55,18 @@ OAITag::fromJson(QString jsonString) { } void -OAITag::fromJsonObject(QJsonObject json) { +PFXTag::fromJsonObject(QJsonObject json) { - m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); - - - m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); + m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; } QString -OAITag::asJson () const { +PFXTag::asJson () const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); @@ -73,41 +74,41 @@ OAITag::asJson () const { } QJsonObject -OAITag::asJsonObject() const { +PFXTag::asJsonObject() const { QJsonObject obj; if(m_id_isSet){ - obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); } if(m_name_isSet){ - obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); } return obj; } qint64 -OAITag::getId() const { +PFXTag::getId() const { return id; } void -OAITag::setId(const qint64 &id) { +PFXTag::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } QString -OAITag::getName() const { +PFXTag::getName() const { return name; } void -OAITag::setName(const QString &name) { +PFXTag::setName(const QString &name) { this->name = name; this->m_name_isSet = true; } bool -OAITag::isSet() const { +PFXTag::isSet() const { bool isObjectUpdated = false; do{ if(m_id_isSet){ isObjectUpdated = true; break;} @@ -118,7 +119,7 @@ OAITag::isSet() const { } bool -OAITag::isValid() const { +PFXTag::isValid() const { // only required properties are required for the object to be considered valid return true; } diff --git a/samples/client/petstore/cpp-qt5/client/OAITag.h b/samples/client/petstore/cpp-qt5/client/PFXTag.h similarity index 77% rename from samples/client/petstore/cpp-qt5/client/OAITag.h rename to samples/client/petstore/cpp-qt5/client/PFXTag.h index 2c8eb291d0f..0ac8fe37085 100644 --- a/samples/client/petstore/cpp-qt5/client/OAITag.h +++ b/samples/client/petstore/cpp-qt5/client/PFXTag.h @@ -11,30 +11,30 @@ */ /* - * OAITag.h + * PFXTag.h * * A tag for a pet */ -#ifndef OAITag_H -#define OAITag_H +#ifndef PFXTag_H +#define PFXTag_H #include #include -#include "OAIObject.h" -#include "OAIEnum.h" +#include "PFXObject.h" +#include "PFXEnum.h" -namespace OpenAPI { +namespace test_namespace { -class OAITag: public OAIObject { +class PFXTag: public PFXObject { public: - OAITag(); - OAITag(QString json); - ~OAITag() override; + PFXTag(); + PFXTag(QString json); + ~PFXTag() override; QString asJson () const override; QJsonObject asJsonObject() const override; @@ -55,7 +55,7 @@ public: virtual bool isValid() const override; private: - void init(); + void initializeModel(); qint64 id; bool m_id_isSet; @@ -69,6 +69,6 @@ private: } -Q_DECLARE_METATYPE(OpenAPI::OAITag) +Q_DECLARE_METATYPE(test_namespace::PFXTag) -#endif // OAITag_H +#endif // PFXTag_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIUser.cpp b/samples/client/petstore/cpp-qt5/client/PFXUser.cpp similarity index 51% rename from samples/client/petstore/cpp-qt5/client/OAIUser.cpp rename to samples/client/petstore/cpp-qt5/client/PFXUser.cpp index 2afe6d808eb..d77213bfd86 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUser.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXUser.cpp @@ -11,32 +11,32 @@ */ -#include "OAIUser.h" +#include "PFXUser.h" #include #include #include #include -#include "OAIHelpers.h" +#include "PFXHelpers.h" -namespace OpenAPI { +namespace test_namespace { -OAIUser::OAIUser(QString json) { - this->init(); +PFXUser::PFXUser(QString json) { + this->initializeModel(); this->fromJson(json); } -OAIUser::OAIUser() { - this->init(); +PFXUser::PFXUser() { + this->initializeModel(); } -OAIUser::~OAIUser() { +PFXUser::~PFXUser() { } void -OAIUser::init() { +PFXUser::initializeModel() { m_id_isSet = false; m_id_isValid = false; @@ -61,10 +61,11 @@ OAIUser::init() { m_user_status_isSet = false; m_user_status_isValid = false; - } + +} void -OAIUser::fromJson(QString jsonString) { +PFXUser::fromJson(QString jsonString) { QByteArray array (jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -72,36 +73,36 @@ OAIUser::fromJson(QString jsonString) { } void -OAIUser::fromJsonObject(QJsonObject json) { +PFXUser::fromJsonObject(QJsonObject json) { - m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_username_isValid = ::test_namespace::fromJsonValue(username, json[QString("username")]); + m_username_isSet = !json[QString("username")].isNull() && m_username_isValid; - m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]); + m_first_name_isValid = ::test_namespace::fromJsonValue(first_name, json[QString("firstName")]); + m_first_name_isSet = !json[QString("firstName")].isNull() && m_first_name_isValid; + m_last_name_isValid = ::test_namespace::fromJsonValue(last_name, json[QString("lastName")]); + m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid; - m_first_name_isValid = ::OpenAPI::fromJsonValue(first_name, json[QString("firstName")]); + m_email_isValid = ::test_namespace::fromJsonValue(email, json[QString("email")]); + m_email_isSet = !json[QString("email")].isNull() && m_email_isValid; + m_password_isValid = ::test_namespace::fromJsonValue(password, json[QString("password")]); + m_password_isSet = !json[QString("password")].isNull() && m_password_isValid; - m_last_name_isValid = ::OpenAPI::fromJsonValue(last_name, json[QString("lastName")]); - - - m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]); - - - m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]); - - - m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]); - - - m_user_status_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]); + m_phone_isValid = ::test_namespace::fromJsonValue(phone, json[QString("phone")]); + m_phone_isSet = !json[QString("phone")].isNull() && m_phone_isValid; + m_user_status_isValid = ::test_namespace::fromJsonValue(user_status, json[QString("userStatus")]); + m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid; } QString -OAIUser::asJson () const { +PFXUser::asJson () const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); @@ -109,125 +110,125 @@ OAIUser::asJson () const { } QJsonObject -OAIUser::asJsonObject() const { +PFXUser::asJsonObject() const { QJsonObject obj; if(m_id_isSet){ - obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); } if(m_username_isSet){ - obj.insert(QString("username"), ::OpenAPI::toJsonValue(username)); + obj.insert(QString("username"), ::test_namespace::toJsonValue(username)); } if(m_first_name_isSet){ - obj.insert(QString("firstName"), ::OpenAPI::toJsonValue(first_name)); + obj.insert(QString("firstName"), ::test_namespace::toJsonValue(first_name)); } if(m_last_name_isSet){ - obj.insert(QString("lastName"), ::OpenAPI::toJsonValue(last_name)); + obj.insert(QString("lastName"), ::test_namespace::toJsonValue(last_name)); } if(m_email_isSet){ - obj.insert(QString("email"), ::OpenAPI::toJsonValue(email)); + obj.insert(QString("email"), ::test_namespace::toJsonValue(email)); } if(m_password_isSet){ - obj.insert(QString("password"), ::OpenAPI::toJsonValue(password)); + obj.insert(QString("password"), ::test_namespace::toJsonValue(password)); } if(m_phone_isSet){ - obj.insert(QString("phone"), ::OpenAPI::toJsonValue(phone)); + obj.insert(QString("phone"), ::test_namespace::toJsonValue(phone)); } if(m_user_status_isSet){ - obj.insert(QString("userStatus"), ::OpenAPI::toJsonValue(user_status)); + obj.insert(QString("userStatus"), ::test_namespace::toJsonValue(user_status)); } return obj; } qint64 -OAIUser::getId() const { +PFXUser::getId() const { return id; } void -OAIUser::setId(const qint64 &id) { +PFXUser::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } QString -OAIUser::getUsername() const { +PFXUser::getUsername() const { return username; } void -OAIUser::setUsername(const QString &username) { +PFXUser::setUsername(const QString &username) { this->username = username; this->m_username_isSet = true; } QString -OAIUser::getFirstName() const { +PFXUser::getFirstName() const { return first_name; } void -OAIUser::setFirstName(const QString &first_name) { +PFXUser::setFirstName(const QString &first_name) { this->first_name = first_name; this->m_first_name_isSet = true; } QString -OAIUser::getLastName() const { +PFXUser::getLastName() const { return last_name; } void -OAIUser::setLastName(const QString &last_name) { +PFXUser::setLastName(const QString &last_name) { this->last_name = last_name; this->m_last_name_isSet = true; } QString -OAIUser::getEmail() const { +PFXUser::getEmail() const { return email; } void -OAIUser::setEmail(const QString &email) { +PFXUser::setEmail(const QString &email) { this->email = email; this->m_email_isSet = true; } QString -OAIUser::getPassword() const { +PFXUser::getPassword() const { return password; } void -OAIUser::setPassword(const QString &password) { +PFXUser::setPassword(const QString &password) { this->password = password; this->m_password_isSet = true; } QString -OAIUser::getPhone() const { +PFXUser::getPhone() const { return phone; } void -OAIUser::setPhone(const QString &phone) { +PFXUser::setPhone(const QString &phone) { this->phone = phone; this->m_phone_isSet = true; } qint32 -OAIUser::getUserStatus() const { +PFXUser::getUserStatus() const { return user_status; } void -OAIUser::setUserStatus(const qint32 &user_status) { +PFXUser::setUserStatus(const qint32 &user_status) { this->user_status = user_status; this->m_user_status_isSet = true; } bool -OAIUser::isSet() const { +PFXUser::isSet() const { bool isObjectUpdated = false; do{ if(m_id_isSet){ isObjectUpdated = true; break;} @@ -250,7 +251,7 @@ OAIUser::isSet() const { } bool -OAIUser::isValid() const { +PFXUser::isValid() const { // only required properties are required for the object to be considered valid return true; } diff --git a/samples/client/petstore/cpp-qt5/client/OAIUser.h b/samples/client/petstore/cpp-qt5/client/PFXUser.h similarity index 87% rename from samples/client/petstore/cpp-qt5/client/OAIUser.h rename to samples/client/petstore/cpp-qt5/client/PFXUser.h index 29da83043b6..bfda4d5e4e0 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUser.h +++ b/samples/client/petstore/cpp-qt5/client/PFXUser.h @@ -11,30 +11,30 @@ */ /* - * OAIUser.h + * PFXUser.h * * A User who is purchasing from the pet store */ -#ifndef OAIUser_H -#define OAIUser_H +#ifndef PFXUser_H +#define PFXUser_H #include #include -#include "OAIObject.h" -#include "OAIEnum.h" +#include "PFXObject.h" +#include "PFXEnum.h" -namespace OpenAPI { +namespace test_namespace { -class OAIUser: public OAIObject { +class PFXUser: public PFXObject { public: - OAIUser(); - OAIUser(QString json); - ~OAIUser() override; + PFXUser(); + PFXUser(QString json); + ~PFXUser() override; QString asJson () const override; QJsonObject asJsonObject() const override; @@ -79,7 +79,7 @@ public: virtual bool isValid() const override; private: - void init(); + void initializeModel(); qint64 id; bool m_id_isSet; @@ -117,6 +117,6 @@ private: } -Q_DECLARE_METATYPE(OpenAPI::OAIUser) +Q_DECLARE_METATYPE(test_namespace::PFXUser) -#endif // OAIUser_H +#endif // PFXUser_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp similarity index 57% rename from samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp rename to samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp index 05391dc93d3..07c5edb9b90 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp @@ -10,60 +10,66 @@ * Do not edit the class manually. */ -#include "OAIUserApi.h" -#include "OAIHelpers.h" +#include "PFXUserApi.h" +#include "PFXHelpers.h" #include #include -namespace OpenAPI { - -OAIUserApi::OAIUserApi() : basePath("/v2"), - host("petstore.swagger.io"), - timeout(0){ +namespace test_namespace { +PFXUserApi::PFXUserApi(const QString &scheme, const QString &host, int port, const QString& basePath, const int timeOut) : + _scheme(scheme), + _host(host), + _port(port), + _basePath(basePath), + _timeOut(timeOut) { } -OAIUserApi::~OAIUserApi() { - +PFXUserApi::~PFXUserApi() { } -OAIUserApi::OAIUserApi(const QString& host, const QString& basePath, const int tout) { - this->host = host; - this->basePath = basePath; - this->timeout = tout; +void PFXUserApi::setScheme(const QString& scheme){ + _scheme = scheme; } -void OAIUserApi::setBasePath(const QString& basePath){ - this->basePath = basePath; +void PFXUserApi::setHost(const QString& host){ + _host = host; } -void OAIUserApi::setHost(const QString& host){ - this->host = host; +void PFXUserApi::setPort(int port){ + _port = port; } -void OAIUserApi::setApiTimeOutMs(const int tout){ - timeout = tout; +void PFXUserApi::setBasePath(const QString& basePath){ + _basePath = basePath; } -void OAIUserApi::setWorkingDirectory(const QString& path){ - workingDirectory = path; +void PFXUserApi::setTimeOut(const int timeOut){ + _timeOut = timeOut; } -void OAIUserApi::addHeaders(const QString& key, const QString& value){ +void PFXUserApi::setWorkingDirectory(const QString& path){ + _workingDirectory = path; +} + +void PFXUserApi::addHeaders(const QString& key, const QString& value){ defaultHeaders.insert(key, value); } - void -OAIUserApi::createUser(const OAIUser& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user"); +PFXUserApi::createUser(const PFXUser& body) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "POST"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -75,15 +81,15 @@ OAIUserApi::createUser(const OAIUser& body) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::createUserCallback); + &PFXUserApi::createUserCallback); worker->execute(&input); } void -OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::createUserCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -106,17 +112,21 @@ OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::createUsersWithArrayInput(const QList& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/createWithArray"); +PFXUserApi::createUsersWithArrayInput(const QList& body) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user/createWithArray"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "POST"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "POST"); - QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray()); + QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); @@ -126,15 +136,15 @@ OAIUserApi::createUsersWithArrayInput(const QList& body) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::createUsersWithArrayInputCallback); + &PFXUserApi::createUsersWithArrayInputCallback); worker->execute(&input); } void -OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::createUsersWithArrayInputCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -157,17 +167,21 @@ OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::createUsersWithListInput(const QList& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/createWithList"); +PFXUserApi::createUsersWithListInput(const QList& body) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user/createWithList"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "POST"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "POST"); - QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray()); + QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); @@ -177,15 +191,15 @@ OAIUserApi::createUsersWithListInput(const QList& body) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::createUsersWithListInputCallback); + &PFXUserApi::createUsersWithListInputCallback); worker->execute(&input); } void -OAIUserApi::createUsersWithListInputCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::createUsersWithListInputCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -208,17 +222,21 @@ OAIUserApi::createUsersWithListInputCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::deleteUser(const QString& username) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/{username}"); +PFXUserApi::deleteUser(const QString& username) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user/{username}"); QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); + fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "DELETE"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "DELETE"); @@ -227,15 +245,15 @@ OAIUserApi::deleteUser(const QString& username) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::deleteUserCallback); + &PFXUserApi::deleteUserCallback); worker->execute(&input); } void -OAIUserApi::deleteUserCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::deleteUserCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -258,17 +276,21 @@ OAIUserApi::deleteUserCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::getUserByName(const QString& username) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/{username}"); +PFXUserApi::getUserByName(const QString& username) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user/{username}"); QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); + fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -277,15 +299,15 @@ OAIUserApi::getUserByName(const QString& username) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::getUserByNameCallback); + &PFXUserApi::getUserByNameCallback); worker->execute(&input); } void -OAIUserApi::getUserByNameCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::getUserByNameCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -296,7 +318,7 @@ OAIUserApi::getUserByNameCallback(OAIHttpRequestWorker * worker) { else { msg = "Error: " + worker->error_str; } - OAIUser output(QString(worker->response)); + PFXUser output(QString(worker->response)); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { @@ -309,9 +331,13 @@ OAIUserApi::getUserByNameCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::loginUser(const QString& username, const QString& password) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/login"); +PFXUserApi::loginUser(const QString& username, const QString& password) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user/login"); if (fullPath.indexOf("?") > 0) fullPath.append("&"); @@ -319,7 +345,7 @@ OAIUserApi::loginUser(const QString& username, const QString& password) { fullPath.append("?"); fullPath.append(QUrl::toPercentEncoding("username")) .append("=") - .append(QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); + .append(QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); if (fullPath.indexOf("?") > 0) fullPath.append("&"); @@ -327,12 +353,12 @@ OAIUserApi::loginUser(const QString& username, const QString& password) { fullPath.append("?"); fullPath.append(QUrl::toPercentEncoding("password")) .append("=") - .append(QUrl::toPercentEncoding(::OpenAPI::toStringValue(password))); + .append(QUrl::toPercentEncoding(::test_namespace::toStringValue(password))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -341,15 +367,15 @@ OAIUserApi::loginUser(const QString& username, const QString& password) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::loginUserCallback); + &PFXUserApi::loginUserCallback); worker->execute(&input); } void -OAIUserApi::loginUserCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::loginUserCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -361,7 +387,7 @@ OAIUserApi::loginUserCallback(OAIHttpRequestWorker * worker) { msg = "Error: " + worker->error_str; } QString output; - ::OpenAPI::fromStringValue(QString(worker->response), output); + ::test_namespace::fromStringValue(QString(worker->response), output); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { @@ -374,14 +400,18 @@ OAIUserApi::loginUserCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::logoutUser() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/logout"); +PFXUserApi::logoutUser() { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user/logout"); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "GET"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "GET"); @@ -390,15 +420,15 @@ OAIUserApi::logoutUser() { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::logoutUserCallback); + &PFXUserApi::logoutUserCallback); worker->execute(&input); } void -OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::logoutUserCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -421,17 +451,21 @@ OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::updateUser(const QString& username, const OAIUser& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/{username}"); +PFXUserApi::updateUser(const QString& username, const PFXUser& body) { + QString fullPath = QString("%0://%1%2%3%4") + .arg(_scheme) + .arg(_host) + .arg(_port ? ":" + QString::number(_port) : "") + .arg(_basePath) + .arg("/user/{username}"); QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); + fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); - OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); - worker->setTimeOut(timeout); - worker->setWorkingDirectory(workingDirectory); - OAIHttpRequestInput input(fullPath, "PUT"); + PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); + worker->setTimeOut(_timeOut); + worker->setWorkingDirectory(_workingDirectory); + PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); @@ -443,15 +477,15 @@ OAIUserApi::updateUser(const QString& username, const OAIUser& body) { } connect(worker, - &OAIHttpRequestWorker::on_execution_finished, + &PFXHttpRequestWorker::on_execution_finished, this, - &OAIUserApi::updateUserCallback); + &PFXUserApi::updateUserCallback); worker->execute(&input); } void -OAIUserApi::updateUserCallback(OAIHttpRequestWorker * worker) { +PFXUserApi::updateUserCallback(PFXHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h new file mode 100644 index 00000000000..afb098152c7 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h @@ -0,0 +1,104 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef PFX_PFXUserApi_H +#define PFX_PFXUserApi_H + +#include "PFXHttpRequest.h" + +#include "PFXUser.h" +#include +#include + +#include + +namespace test_namespace { + +class PFXUserApi: public QObject { + Q_OBJECT + +public: + PFXUserApi(const QString &scheme = "http", const QString &host = "petstore.swagger.io", int port = 0, const QString& basePath = "/v2", const int timeOut = 0); + ~PFXUserApi(); + + void setScheme(const QString &scheme); + void setHost(const QString &host); + void setPort(int port); + void setBasePath(const QString& basePath); + void setTimeOut(const int timeOut); + void setWorkingDirectory(const QString& path); + void addHeaders(const QString& key, const QString& value); + + void createUser(const PFXUser& body); + void createUsersWithArrayInput(const QList& body); + void createUsersWithListInput(const QList& body); + void deleteUser(const QString& username); + void getUserByName(const QString& username); + void loginUser(const QString& username, const QString& password); + void logoutUser(); + void updateUser(const QString& username, const PFXUser& body); + +private: + QString _scheme, _host, _basePath; + int _port, _timeOut; + QString _workingDirectory; + QMap defaultHeaders; + void createUserCallback (PFXHttpRequestWorker * worker); + void createUsersWithArrayInputCallback (PFXHttpRequestWorker * worker); + void createUsersWithListInputCallback (PFXHttpRequestWorker * worker); + void deleteUserCallback (PFXHttpRequestWorker * worker); + void getUserByNameCallback (PFXHttpRequestWorker * worker); + void loginUserCallback (PFXHttpRequestWorker * worker); + void logoutUserCallback (PFXHttpRequestWorker * worker); + void updateUserCallback (PFXHttpRequestWorker * worker); + +signals: + void createUserSignal(); + void createUsersWithArrayInputSignal(); + void createUsersWithListInputSignal(); + void deleteUserSignal(); + void getUserByNameSignal(PFXUser summary); + void loginUserSignal(QString summary); + void logoutUserSignal(); + void updateUserSignal(); + + void createUserSignalFull(PFXHttpRequestWorker* worker); + void createUsersWithArrayInputSignalFull(PFXHttpRequestWorker* worker); + void createUsersWithListInputSignalFull(PFXHttpRequestWorker* worker); + void deleteUserSignalFull(PFXHttpRequestWorker* worker); + void getUserByNameSignalFull(PFXHttpRequestWorker* worker, PFXUser summary); + void loginUserSignalFull(PFXHttpRequestWorker* worker, QString summary); + void logoutUserSignalFull(PFXHttpRequestWorker* worker); + void updateUserSignalFull(PFXHttpRequestWorker* worker); + + void createUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void deleteUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void getUserByNameSignalE(PFXUser summary, QNetworkReply::NetworkError error_type, QString error_str); + void loginUserSignalE(QString summary, QNetworkReply::NetworkError error_type, QString error_str); + void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); + void updateUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); + + void createUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void createUsersWithArrayInputSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void createUsersWithListInputSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void deleteUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void getUserByNameSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void loginUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void logoutUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + void updateUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); + +}; + +} +#endif diff --git a/samples/client/petstore/cpp-qt5/client/PFXclient.pri b/samples/client/petstore/cpp-qt5/client/PFXclient.pri new file mode 100644 index 00000000000..e86f90006a1 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/PFXclient.pri @@ -0,0 +1,38 @@ +QT += network + +HEADERS += \ +# Models + $${PWD}/PFXApiResponse.h \ + $${PWD}/PFXCategory.h \ + $${PWD}/PFXOrder.h \ + $${PWD}/PFXPet.h \ + $${PWD}/PFXTag.h \ + $${PWD}/PFXUser.h \ +# APIs + $${PWD}/PFXPetApi.h \ + $${PWD}/PFXStoreApi.h \ + $${PWD}/PFXUserApi.h \ +# Others + $${PWD}/PFXHelpers.h \ + $${PWD}/PFXHttpRequest.h \ + $${PWD}/PFXObject.h \ + $${PWD}/PFXEnum.h \ + $${PWD}/PFXHttpFileElement.h + +SOURCES += \ +# Models + $${PWD}/PFXApiResponse.cpp \ + $${PWD}/PFXCategory.cpp \ + $${PWD}/PFXOrder.cpp \ + $${PWD}/PFXPet.cpp \ + $${PWD}/PFXTag.cpp \ + $${PWD}/PFXUser.cpp \ +# APIs + $${PWD}/PFXPetApi.cpp \ + $${PWD}/PFXStoreApi.cpp \ + $${PWD}/PFXUserApi.cpp \ +# Others + $${PWD}/PFXHelpers.cpp \ + $${PWD}/PFXHttpRequest.cpp \ + $${PWD}/PFXHttpFileElement.cpp + diff --git a/samples/client/petstore/cpp-qt5/client/client.pri b/samples/client/petstore/cpp-qt5/client/client.pri deleted file mode 100644 index 3e98ae6c8d2..00000000000 --- a/samples/client/petstore/cpp-qt5/client/client.pri +++ /dev/null @@ -1,38 +0,0 @@ -QT += network - -HEADERS += \ -# Models - $${PWD}/OAIApiResponse.h \ - $${PWD}/OAICategory.h \ - $${PWD}/OAIOrder.h \ - $${PWD}/OAIPet.h \ - $${PWD}/OAITag.h \ - $${PWD}/OAIUser.h \ -# APIs - $${PWD}/OAIPetApi.h \ - $${PWD}/OAIStoreApi.h \ - $${PWD}/OAIUserApi.h \ -# Others - $${PWD}/OAIHelpers.h \ - $${PWD}/OAIHttpRequest.h \ - $${PWD}/OAIObject.h \ - $${PWD}/OAIEnum.h \ - $${PWD}/OAIHttpFileElement.h - -SOURCES += \ -# Models - $${PWD}/OAIApiResponse.cpp \ - $${PWD}/OAICategory.cpp \ - $${PWD}/OAIOrder.cpp \ - $${PWD}/OAIPet.cpp \ - $${PWD}/OAITag.cpp \ - $${PWD}/OAIUser.cpp \ -# APIs - $${PWD}/OAIPetApi.cpp \ - $${PWD}/OAIStoreApi.cpp \ - $${PWD}/OAIUserApi.cpp \ -# Others - $${PWD}/OAIHelpers.cpp \ - $${PWD}/OAIHttpRequest.cpp \ - $${PWD}/OAIHttpFileElement.cpp - diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 0071562ed26..5aeb569a1a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -350,7 +350,9 @@ namespace Org.OpenAPITools.Client private ApiResponse toApiResponse(IRestResponse response) { T result = response.Data; - var transformed = new ApiResponse(response.StatusCode, new Multimap(), result) + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) { ErrorText = response.ErrorMessage, Cookies = new List() diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs index f56fd53e55b..de1a8f4809e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -51,6 +51,11 @@ namespace Org.OpenAPITools.Client /// Gets or sets any cookies passed along on the response. /// List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } } /// @@ -103,6 +108,11 @@ namespace Org.OpenAPITools.Client { get { return Data; } } + + /// + /// The raw content + /// + public string RawContent { get;} #endregion Properties @@ -114,11 +124,23 @@ namespace Org.OpenAPITools.Client /// HTTP status code. /// HTTP headers. /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) { StatusCode = statusCode; Headers = headers; Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { } /// @@ -126,10 +148,18 @@ namespace Org.OpenAPITools.Client /// /// HTTP status code. /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) { - StatusCode = statusCode; - Data = data; } #endregion Constructors diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs index 177363611d6..be86ab28620 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Client if (status >= 400) { return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.Content), - response.Content); + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent); } return null; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs index f68650fa7bc..1a4735a1cc4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -351,7 +351,9 @@ namespace Org.OpenAPITools.Client private ApiResponse toApiResponse(IRestResponse response) { T result = response.Data; - var transformed = new ApiResponse(response.StatusCode, new Multimap(), result) + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) { ErrorText = response.ErrorMessage, Cookies = new List() diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiResponse.cs index f56fd53e55b..de1a8f4809e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -51,6 +51,11 @@ namespace Org.OpenAPITools.Client /// Gets or sets any cookies passed along on the response. /// List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } } /// @@ -103,6 +108,11 @@ namespace Org.OpenAPITools.Client { get { return Data; } } + + /// + /// The raw content + /// + public string RawContent { get;} #endregion Properties @@ -114,11 +124,23 @@ namespace Org.OpenAPITools.Client /// HTTP status code. /// HTTP headers. /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) { StatusCode = statusCode; Headers = headers; Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { } /// @@ -126,10 +148,18 @@ namespace Org.OpenAPITools.Client /// /// HTTP status code. /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) { - StatusCode = statusCode; - Data = data; } #endregion Constructors diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs index 4c0720e504a..11e5a8452fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Client if (status >= 400) { return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.Content), - response.Content); + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent); } if (status == 0) { diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION index c3a2c7076fa..d99e7162d01 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION index c3a2c7076fa..d99e7162d01 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION index c3a2c7076fa..d99e7162d01 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION index c3a2c7076fa..d99e7162d01 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index b99ddeeccb1..3524b1301f3 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart @@ -137,6 +137,8 @@ class ApiClient { return client.delete(url, headers: headerParams); case "PATCH": return client.patch(url, headers: headerParams, body: msgBody); + case "HEAD": + return client.head(url, headers: headerParams); default: return client.get(url, headers: headerParams); } diff --git a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart index 4875b70b978..86c232a65a8 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart @@ -137,6 +137,8 @@ class ApiClient { return client.delete(url, headers: headerParams); case "PATCH": return client.patch(url, headers: headerParams, body: msgBody); + case "HEAD": + return client.head(url, headers: headerParams); default: return client.get(url, headers: headerParams); } diff --git a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart/openapi/lib/api_client.dart b/samples/client/petstore/dart/openapi/lib/api_client.dart index b99ddeeccb1..3524b1301f3 100644 --- a/samples/client/petstore/dart/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/openapi/lib/api_client.dart @@ -137,6 +137,8 @@ class ApiClient { return client.delete(url, headers: headerParams); case "PATCH": return client.patch(url, headers: headerParams, body: msgBody); + case "HEAD": + return client.head(url, headers: headerParams); default: return client.get(url, headers: headerParams); } diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/dart2/openapi/lib/api_client.dart b/samples/client/petstore/dart2/openapi/lib/api_client.dart index fcf60c919f8..793ac6a7341 100644 --- a/samples/client/petstore/dart2/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_client.dart @@ -137,6 +137,8 @@ class ApiClient { return client.delete(url, headers: headerParams); case "PATCH": return client.patch(url, headers: headerParams, body: msgBody); + case "HEAD": + return client.head(url, headers: headerParams); default: return client.get(url, headers: headerParams); } diff --git a/samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION b/samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/elm-0.18/.openapi-generator/VERSION b/samples/client/petstore/elm-0.18/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/elm-0.18/.openapi-generator/VERSION +++ b/samples/client/petstore/elm-0.18/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/elm-0.18/src/Data/ApiResponse.elm b/samples/client/petstore/elm-0.18/src/Data/ApiResponse.elm index 1e5d44b7941..4513a239058 100644 --- a/samples/client/petstore/elm-0.18/src/Data/ApiResponse.elm +++ b/samples/client/petstore/elm-0.18/src/Data/ApiResponse.elm @@ -10,7 +10,7 @@ -} -module Data.ApiResponse exposing (ApiResponse, decoder, encode, toString) +module Data.ApiResponse exposing (ApiResponse, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -36,12 +36,21 @@ decoder = encode : ApiResponse -> Encode.Value -encode model = - Encode.object - [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) - , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) - , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> ApiResponse -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : ApiResponse -> List ( String, Encode.Value ) +encodePairs model = + [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) + , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) + , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) + ] toString : ApiResponse -> String diff --git a/samples/client/petstore/elm-0.18/src/Data/Category.elm b/samples/client/petstore/elm-0.18/src/Data/Category.elm index f8e5a7fb31d..bd3b810819b 100644 --- a/samples/client/petstore/elm-0.18/src/Data/Category.elm +++ b/samples/client/petstore/elm-0.18/src/Data/Category.elm @@ -10,7 +10,7 @@ -} -module Data.Category exposing (Category, decoder, encode, toString) +module Data.Category exposing (Category, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -34,11 +34,20 @@ decoder = encode : Category -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Category -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Category -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) + ] toString : Category -> String diff --git a/samples/client/petstore/elm-0.18/src/Data/Order_.elm b/samples/client/petstore/elm-0.18/src/Data/Order_.elm index 0d8e8781098..bf2203ec13e 100644 --- a/samples/client/petstore/elm-0.18/src/Data/Order_.elm +++ b/samples/client/petstore/elm-0.18/src/Data/Order_.elm @@ -10,7 +10,7 @@ -} -module Data.Order_ exposing (Order_, Status(..), decoder, encode, toString) +module Data.Order_ exposing (Order_, Status(..), decoder, encode, encodeWithTag, toString) import DateTime exposing (DateTime) import Dict exposing (Dict) @@ -49,15 +49,24 @@ decoder = encode : Order_ -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) - , ( "quantity", Maybe.withDefault Encode.null (Maybe.map Encode.int model.quantity) ) - , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) - , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) - , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Order_ -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Order_ -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) + , ( "quantity", Maybe.withDefault Encode.null (Maybe.map Encode.int model.quantity) ) + , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) + , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) + , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) + ] toString : Order_ -> String diff --git a/samples/client/petstore/elm-0.18/src/Data/Pet.elm b/samples/client/petstore/elm-0.18/src/Data/Pet.elm index 50f39279e10..166695c26af 100644 --- a/samples/client/petstore/elm-0.18/src/Data/Pet.elm +++ b/samples/client/petstore/elm-0.18/src/Data/Pet.elm @@ -10,7 +10,7 @@ -} -module Data.Pet exposing (Pet, Status(..), decoder, encode, toString) +module Data.Pet exposing (Pet, Status(..), decoder, encode, encodeWithTag, toString) import Data.Category as Category exposing (Category) import Data.Tag as Tag exposing (Tag) @@ -50,15 +50,24 @@ decoder = encode : Pet -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) - , ( "name", Encode.string model.name ) - , ( "photoUrls", (Encode.list << List.map Encode.string) model.photoUrls ) - , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list << List.map Tag.encode) model.tags) ) - , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Pet -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Pet -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) + , ( "name", Encode.string model.name ) + , ( "photoUrls", (Encode.list << List.map Encode.string) model.photoUrls ) + , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list << List.map Tag.encode) model.tags) ) + , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) + ] toString : Pet -> String diff --git a/samples/client/petstore/elm-0.18/src/Data/Tag.elm b/samples/client/petstore/elm-0.18/src/Data/Tag.elm index 81b9407409b..631119b0416 100644 --- a/samples/client/petstore/elm-0.18/src/Data/Tag.elm +++ b/samples/client/petstore/elm-0.18/src/Data/Tag.elm @@ -10,7 +10,7 @@ -} -module Data.Tag exposing (Tag, decoder, encode, toString) +module Data.Tag exposing (Tag, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -34,11 +34,20 @@ decoder = encode : Tag -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Tag -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Tag -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) + ] toString : Tag -> String diff --git a/samples/client/petstore/elm-0.18/src/Data/User.elm b/samples/client/petstore/elm-0.18/src/Data/User.elm index 5b27dc8e183..ad632f6becc 100644 --- a/samples/client/petstore/elm-0.18/src/Data/User.elm +++ b/samples/client/petstore/elm-0.18/src/Data/User.elm @@ -10,7 +10,7 @@ -} -module Data.User exposing (User, decoder, encode, toString) +module Data.User exposing (User, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -46,17 +46,26 @@ decoder = encode : User -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) - , ( "firstName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.firstName) ) - , ( "lastName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.lastName) ) - , ( "email", Maybe.withDefault Encode.null (Maybe.map Encode.string model.email) ) - , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) - , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) - , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> User -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : User -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) + , ( "firstName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.firstName) ) + , ( "lastName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.lastName) ) + , ( "email", Maybe.withDefault Encode.null (Maybe.map Encode.string model.email) ) + , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) + , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) + , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) + ] toString : User -> String diff --git a/samples/client/petstore/elm/.openapi-generator/VERSION b/samples/client/petstore/elm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/elm/.openapi-generator/VERSION +++ b/samples/client/petstore/elm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/elm/src/Data/ApiResponse.elm b/samples/client/petstore/elm/src/Data/ApiResponse.elm index 08199cab32f..36300e78f78 100644 --- a/samples/client/petstore/elm/src/Data/ApiResponse.elm +++ b/samples/client/petstore/elm/src/Data/ApiResponse.elm @@ -10,7 +10,7 @@ -} -module Data.ApiResponse exposing (ApiResponse, decoder, encode, toString) +module Data.ApiResponse exposing (ApiResponse, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -36,12 +36,21 @@ decoder = encode : ApiResponse -> Encode.Value -encode model = - Encode.object - [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) - , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) - , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> ApiResponse -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : ApiResponse -> List ( String, Encode.Value ) +encodePairs model = + [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) + , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) + , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) + ] toString : ApiResponse -> String diff --git a/samples/client/petstore/elm/src/Data/Category.elm b/samples/client/petstore/elm/src/Data/Category.elm index cd1778b8703..43d1f5f4185 100644 --- a/samples/client/petstore/elm/src/Data/Category.elm +++ b/samples/client/petstore/elm/src/Data/Category.elm @@ -10,7 +10,7 @@ -} -module Data.Category exposing (Category, decoder, encode, toString) +module Data.Category exposing (Category, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -34,11 +34,20 @@ decoder = encode : Category -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Category -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Category -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) + ] toString : Category -> String diff --git a/samples/client/petstore/elm/src/Data/Order_.elm b/samples/client/petstore/elm/src/Data/Order_.elm index aff082a6f67..2ae0003257d 100644 --- a/samples/client/petstore/elm/src/Data/Order_.elm +++ b/samples/client/petstore/elm/src/Data/Order_.elm @@ -10,7 +10,7 @@ -} -module Data.Order_ exposing (Order_, Status(..), decoder, encode, toString) +module Data.Order_ exposing (Order_, Status(..), decoder, encode, encodeWithTag, toString) import DateTime exposing (DateTime) import Dict exposing (Dict) @@ -49,15 +49,24 @@ decoder = encode : Order_ -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) - , ( "quantity", Maybe.withDefault Encode.null (Maybe.map Encode.int model.quantity) ) - , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) - , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) - , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Order_ -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Order_ -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) + , ( "quantity", Maybe.withDefault Encode.null (Maybe.map Encode.int model.quantity) ) + , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) + , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) + , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) + ] toString : Order_ -> String diff --git a/samples/client/petstore/elm/src/Data/Pet.elm b/samples/client/petstore/elm/src/Data/Pet.elm index f024b79c80f..6630115718f 100644 --- a/samples/client/petstore/elm/src/Data/Pet.elm +++ b/samples/client/petstore/elm/src/Data/Pet.elm @@ -10,7 +10,7 @@ -} -module Data.Pet exposing (Pet, Status(..), decoder, encode, toString) +module Data.Pet exposing (Pet, Status(..), decoder, encode, encodeWithTag, toString) import Data.Category as Category exposing (Category) import Data.Tag as Tag exposing (Tag) @@ -50,15 +50,24 @@ decoder = encode : Pet -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) - , ( "name", Encode.string model.name ) - , ( "photoUrls", Encode.list Encode.string model.photoUrls ) - , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) ) - , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Pet -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Pet -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) + , ( "name", Encode.string model.name ) + , ( "photoUrls", Encode.list Encode.string model.photoUrls ) + , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) ) + , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) + ] toString : Pet -> String diff --git a/samples/client/petstore/elm/src/Data/Tag.elm b/samples/client/petstore/elm/src/Data/Tag.elm index 052a4197b28..1a2c9d6b6d7 100644 --- a/samples/client/petstore/elm/src/Data/Tag.elm +++ b/samples/client/petstore/elm/src/Data/Tag.elm @@ -10,7 +10,7 @@ -} -module Data.Tag exposing (Tag, decoder, encode, toString) +module Data.Tag exposing (Tag, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -34,11 +34,20 @@ decoder = encode : Tag -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Tag -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Tag -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) + ] toString : Tag -> String diff --git a/samples/client/petstore/elm/src/Data/User.elm b/samples/client/petstore/elm/src/Data/User.elm index c4b2e3db9cc..8d56f85052b 100644 --- a/samples/client/petstore/elm/src/Data/User.elm +++ b/samples/client/petstore/elm/src/Data/User.elm @@ -10,7 +10,7 @@ -} -module Data.User exposing (User, decoder, encode, toString) +module Data.User exposing (User, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -46,17 +46,26 @@ decoder = encode : User -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) - , ( "firstName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.firstName) ) - , ( "lastName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.lastName) ) - , ( "email", Maybe.withDefault Encode.null (Maybe.map Encode.string model.email) ) - , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) - , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) - , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> User -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : User -> List ( String, Encode.Value ) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) + , ( "firstName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.firstName) ) + , ( "lastName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.lastName) ) + , ( "email", Maybe.withDefault Encode.null (Maybe.map Encode.string model.email) ) + , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) + , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) + , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) + ] toString : User -> String diff --git a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index 73bf022c888..490d804736f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -351,6 +351,9 @@ func (c *APIClient) prepareRequest( } func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } if s, ok := v.(*string); ok { *s = string(b) return nil diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index c73a8db8d09..343078e15cd 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -350,6 +350,9 @@ func (c *APIClient) prepareRequest( } func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } if s, ok := v.(*string); ok { *s = string(b) return nil diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index baf222ae11c..884cb75a2ba 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -28,6 +28,7 @@ repositories { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" + jackson_databind_version = "2.9.10.1" } dependencies { @@ -35,7 +36,7 @@ dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" - compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile 'io.github.http-builder-ng:http-builder-ng-core:1.0.3' diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION b/samples/client/petstore/java/feign10x/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign10x/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index b321101fa13..a84e8f60020 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -97,7 +97,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" google_api_client_version = "1.23.0" jersey_common_version = "2.25.1" diff --git a/samples/client/petstore/java/google-api-client/build.sbt b/samples/client/petstore/java/google-api-client/build.sbt index 6997a7b4aa4..010aeb2783d 100644 --- a/samples/client/petstore/java/google-api-client/build.sbt +++ b/samples/client/petstore/java/google-api-client/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index 593b8d20ffc..e99897809e8 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -259,7 +259,7 @@ 1.30.2 2.25.1 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index c915acb96a6..2c4a3af46cb 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -113,7 +113,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" jersey_version = "1.19.4" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/jersey2-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt index c79af88c587..3bb20e3d1b5 100644 --- a/samples/client/petstore/java/jersey2-java6/build.sbt +++ b/samples/client/petstore/java/jersey2-java6/build.sbt @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.6", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.brsanthu" % "migbase64" % "2.2", "org.apache.commons" % "commons-lang3" % "3.6", diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index 19754477d9d..70150988b35 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -291,7 +291,7 @@ 2.5 3.6 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 646b451a543..1c2b2d6f336 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -96,7 +96,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" jersey_version = "2.27" junit_version = "4.12" diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index b07ce9ccc08..d4c35713aef 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index b81f6e210a3..475b490728e 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -278,7 +278,7 @@ 1.5.22 2.27 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 1.0.0 4.12 diff --git a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/jersey2/build.gradle b/samples/client/petstore/java/jersey2/build.gradle index d46e3b0a8b1..ac168318d96 100644 --- a/samples/client/petstore/java/jersey2/build.gradle +++ b/samples/client/petstore/java/jersey2/build.gradle @@ -96,7 +96,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" jersey_version = "2.27" junit_version = "4.12" diff --git a/samples/client/petstore/java/jersey2/build.sbt b/samples/client/petstore/java/jersey2/build.sbt index 20b9bf85680..88c2bdfba5c 100644 --- a/samples/client/petstore/java/jersey2/build.sbt +++ b/samples/client/petstore/java/jersey2/build.sbt @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.brsanthu" % "migbase64" % "2.2", "junit" % "junit" % "4.12" % "test", diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index 6770d11afa6..6e341a40e8f 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -284,7 +284,7 @@ 1.5.22 2.27 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index baa5f332f98..c0e18967283 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -98,7 +98,10 @@ public class AnotherFakeApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 1fff23d16e9..25e6a251831 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -104,7 +104,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -147,7 +150,10 @@ public class FakeApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -190,7 +196,10 @@ public class FakeApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -233,7 +242,10 @@ public class FakeApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -276,7 +288,10 @@ public class FakeApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -321,7 +336,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -380,7 +398,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -427,7 +448,10 @@ public class FakeApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -495,7 +519,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -559,7 +586,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -633,7 +663,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -678,7 +711,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -726,7 +762,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -802,7 +841,10 @@ public class FakeApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index d347fc47776..3132d2bcd1e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -98,7 +98,10 @@ public class FakeClassnameTags123Api { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java index 7eacabd9558..06629c1bf04 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java @@ -98,7 +98,10 @@ public class PetApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -146,7 +149,10 @@ public class PetApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -200,7 +206,10 @@ public class PetApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -256,7 +265,10 @@ public class PetApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -302,7 +314,10 @@ public class PetApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -347,7 +362,10 @@ public class PetApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -393,7 +411,10 @@ public class PetApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -441,7 +462,10 @@ public class PetApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -493,7 +517,10 @@ public class PetApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java index 414389f3f64..0e761f29175 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java @@ -95,7 +95,10 @@ public class StoreApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -135,7 +138,10 @@ public class StoreApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -181,7 +187,10 @@ public class StoreApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -228,7 +237,10 @@ public class StoreApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java index 6dd19134697..8424e4b03a6 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java @@ -96,7 +96,10 @@ public class UserApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -141,7 +144,10 @@ public class UserApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -186,7 +192,10 @@ public class UserApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -230,7 +239,10 @@ public class UserApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -276,7 +288,10 @@ public class UserApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -336,7 +351,10 @@ public class UserApi { } return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -374,7 +392,10 @@ public class UserApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } @@ -425,7 +446,10 @@ public class UserApi { localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - } catch (IOException | InterruptedException e) { + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new ApiException(e); } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java index 2b32dccf324..a3febe1fba1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/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/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 88807867992..bd2a69eafa2 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -96,7 +96,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" threetenbp_version = "2.9.10" resteasy_version = "3.1.3.Final" diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index 970818ece93..b94b8b1e7e3 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", "joda-time" % "joda-time" % "2.9.9" % "compile", diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index eae70733feb..1051701e860 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -244,7 +244,7 @@ 1.5.22 3.1.3.Final 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 2.9.10 2.9.9 diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index bf15581bd7a..b857b47737b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -97,7 +97,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index f1a9c461118..f498ec40eeb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -268,7 +268,7 @@ 1.5.22 4.3.9.RELEASE 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 7c205678775..dbdccb6d1d8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -76,7 +76,7 @@ public class ApiClient { this.separator = separator; } - private String collectionToString(Collection collection) { + private String collectionToString(Collection collection) { return StringUtils.collectionToDelimitedString(collection, separator); } } @@ -395,7 +395,7 @@ public class ApiClient { * @param values The values of the parameter. * @return String representation of the parameter */ - public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { // create the value based on the collection format if (CollectionFormat.MULTI.equals(collectionFormat)) { // not valid for path params diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 228f314f400..fe954fb0282 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -81,7 +81,7 @@ public class AnotherFakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index b81253b2a27..a074f98fc78 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -88,7 +88,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -130,7 +130,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -172,7 +172,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -214,7 +214,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -256,7 +256,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -302,7 +302,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -355,7 +355,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); @@ -404,7 +404,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" @@ -495,7 +495,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (integer != null) formParams.add("integer", integer); @@ -581,7 +581,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); @@ -594,7 +594,7 @@ public class FakeApi { headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); if (enumFormStringArray != null) - formParams.add("enum_form_string_array", enumFormStringArray); + formParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) formParams.add("enum_form_string", enumFormString); @@ -662,7 +662,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); @@ -716,7 +716,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -769,7 +769,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (param != null) formParams.add("param", param); @@ -848,7 +848,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 3a7d224bef4..e71b013c96b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -81,7 +81,7 @@ public class FakeClassnameTags123Api { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index f061786a681..8edc76ba76d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -84,7 +84,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -137,7 +137,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (apiKey != null) headerParams.add("api_key", apiClient.parameterToString(apiKey)); @@ -187,7 +187,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); @@ -240,7 +240,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); @@ -296,7 +296,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" @@ -348,7 +348,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -401,7 +401,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (name != null) formParams.add("name", name); @@ -460,7 +460,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (additionalMetadata != null) formParams.add("additionalMetadata", additionalMetadata); @@ -526,7 +526,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (additionalMetadata != null) formParams.add("additionalMetadata", additionalMetadata); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java index 024afa54d3a..a082609afab 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java @@ -85,7 +85,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -123,7 +123,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" @@ -177,7 +177,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" @@ -226,7 +226,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 3844754d020..a5a7cec5de7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -80,7 +80,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -124,7 +124,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -168,7 +168,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -217,7 +217,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -269,7 +269,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" @@ -325,7 +325,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); @@ -367,7 +367,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -423,7 +423,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/resttemplate/README.md b/samples/client/petstore/java/resttemplate/README.md index c81dcf1c60d..1d1e105954c 100644 --- a/samples/client/petstore/java/resttemplate/README.md +++ b/samples/client/petstore/java/resttemplate/README.md @@ -26,7 +26,7 @@ mvn clean install To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn clean deploy +mvn clean deploy ``` Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index 183613ceea3..848d01a1a12 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -97,7 +97,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index db01327bc5a..ac33a8e2360 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -260,7 +260,7 @@ 1.5.22 4.3.9.RELEASE 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index dd0f9ebd40d..7210077ec81 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -71,7 +71,7 @@ public class ApiClient { this.separator = separator; } - private String collectionToString(Collection collection) { + private String collectionToString(Collection collection) { return StringUtils.collectionToDelimitedString(collection, separator); } } @@ -390,7 +390,7 @@ public class ApiClient { * @param values The values of the parameter. * @return String representation of the parameter */ - public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { // create the value based on the collection format if (CollectionFormat.MULTI.equals(collectionFormat)) { // not valid for path params diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 228f314f400..fe954fb0282 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -81,7 +81,7 @@ public class AnotherFakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index b81253b2a27..a074f98fc78 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -88,7 +88,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -130,7 +130,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -172,7 +172,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -214,7 +214,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -256,7 +256,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "*/*" @@ -302,7 +302,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -355,7 +355,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); @@ -404,7 +404,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" @@ -495,7 +495,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (integer != null) formParams.add("integer", integer); @@ -581,7 +581,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); @@ -594,7 +594,7 @@ public class FakeApi { headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); if (enumFormStringArray != null) - formParams.add("enum_form_string_array", enumFormStringArray); + formParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) formParams.add("enum_form_string", enumFormString); @@ -662,7 +662,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); @@ -716,7 +716,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -769,7 +769,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (param != null) formParams.add("param", param); @@ -848,7 +848,7 @@ public class FakeApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 3a7d224bef4..e71b013c96b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -81,7 +81,7 @@ public class FakeClassnameTags123Api { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index f061786a681..8edc76ba76d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -84,7 +84,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -137,7 +137,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (apiKey != null) headerParams.add("api_key", apiClient.parameterToString(apiKey)); @@ -187,7 +187,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); @@ -240,7 +240,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); @@ -296,7 +296,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" @@ -348,7 +348,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -401,7 +401,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (name != null) formParams.add("name", name); @@ -460,7 +460,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (additionalMetadata != null) formParams.add("additionalMetadata", additionalMetadata); @@ -526,7 +526,7 @@ public class PetApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); if (additionalMetadata != null) formParams.add("additionalMetadata", additionalMetadata); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java index 024afa54d3a..a082609afab 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java @@ -85,7 +85,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -123,7 +123,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/json" @@ -177,7 +177,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" @@ -226,7 +226,7 @@ public class StoreApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 3844754d020..a5a7cec5de7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -80,7 +80,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -124,7 +124,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -168,7 +168,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -217,7 +217,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -269,7 +269,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { "application/xml", "application/json" @@ -325,7 +325,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); @@ -367,7 +367,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); @@ -423,7 +423,7 @@ public class UserApi { final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); diff --git a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index 329612aa192..6ba692a3eb6 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -279,7 +279,7 @@ ${java.version} 1.8.3 1.5.22 - 2.9.10 + 2.9.10.1 2.6.6 2.4.11 0.2.0 diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index 46cbd0af51a..fe180418e7d 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.9.10" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.10" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.1" % "compile", "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index c78aec11c65..5b16aa6a53f 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -284,7 +284,7 @@ ${java.version} 1.8.3 1.5.22 - 2.9.10 + 2.9.10.1 2.9.10 2.5.15 0.2.0 diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index 179857ed9f0..541c3fa8032 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -98,7 +98,7 @@ ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" play_version = "2.6.7" swagger_annotations_version = "1.5.22" diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index bd49c056813..a5dbd177064 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -289,7 +289,7 @@ ${java.version} 1.8.3 1.5.22 - 2.9.10 + 2.9.10.1 2.9.10 2.6.7 0.2.0 diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index 1d51eb1193c..379110a5241 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -29,7 +29,7 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" vertx_version = "3.4.2" junit_version = "4.12" } diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index 54e985acc85..d7e3842ebc5 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -267,7 +267,7 @@ 3.4.2 1.5.22 2.9.10 - 2.9.10 + 2.9.10.1 0.2.0 4.12 diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index 69b9c9a948c..dc82478f47a 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -113,7 +113,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10" + jackson_databind_version = "2.9.10.1" jackson_databind_nullable_version = "0.2.0" jersey_version = "1.19.4" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml index 9dfd60e30f7..405f509aadf 100644 --- a/samples/client/petstore/java/webclient/pom.xml +++ b/samples/client/petstore/java/webclient/pom.xml @@ -121,7 +121,7 @@ UTF-8 1.5.22 - 5.0.7.RELEASE + 5.0.8.RELEASE 2.9.10 2.9.10.1 0.2.0 diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java index efef2ba6047..776694a8b87 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java @@ -74,7 +74,7 @@ public class ApiClient { this.separator = separator; } - private String collectionToString(Collection collection) { + private String collectionToString(Collection collection) { return StringUtils.collectionToDelimitedString(collection, separator); } } @@ -509,6 +509,7 @@ public class ApiClient { * @param the return type to use * @param path The sub-path of the HTTP URL * @param method The request method + * @param pathParams The path parameters * @param queryParams The query parameters * @param body The request body object * @param headerParams The header parameters @@ -519,8 +520,8 @@ public class ApiClient { * @param returnType The return type into which to deserialize the response * @return The response body in chosen type */ - public Mono invokeAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { - final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + public Mono invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); return requestBuilder.retrieve().bodyToMono(returnType); } @@ -530,6 +531,7 @@ public class ApiClient { * @param the return type to use * @param path The sub-path of the HTTP URL * @param method The request method + * @param pathParams The path parameters * @param queryParams The query parameters * @param body The request body object * @param headerParams The header parameters @@ -540,12 +542,12 @@ public class ApiClient { * @param returnType The return type into which to deserialize the response * @return The response body in chosen type */ - public Flux invokeFluxAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { - final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + public Flux invokeFluxAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); return requestBuilder.retrieve().bodyToFlux(returnType); } - private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames) { + private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames) { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); @@ -565,7 +567,7 @@ public class ApiClient { builder.queryParams(queryParams); } - final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.build(true).toUri()); + final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.encode().toUriString(), pathParams); if(accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 9584e60eb95..202d239489f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -61,7 +61,8 @@ public class AnotherFakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags"); } - String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -80,6 +81,6 @@ public class AnotherFakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 1d88cf98c12..25423c5bb27 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -68,7 +68,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem"); } - String path = UriComponentsBuilder.fromPath("/fake/create_xml_item").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -85,7 +86,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * @@ -98,7 +99,8 @@ public class FakeApi { public Mono fakeOuterBooleanSerialize(Boolean body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -115,7 +117,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * @@ -128,7 +130,8 @@ public class FakeApi { public Mono fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -145,7 +148,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * @@ -158,7 +161,8 @@ public class FakeApi { public Mono fakeOuterNumberSerialize(BigDecimal body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/number").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -175,7 +179,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * @@ -188,7 +192,8 @@ public class FakeApi { public Mono fakeOuterStringSerialize(String body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/string").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -205,7 +210,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * @@ -222,7 +227,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); } - String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -239,7 +245,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * @@ -262,7 +268,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); } - String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -281,7 +288,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * To test \"client\" model @@ -299,7 +306,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -318,7 +326,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -364,7 +372,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -410,7 +419,7 @@ public class FakeApi { String[] authNames = new String[] { "http_basic_test" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * To test enum parameters @@ -430,7 +439,8 @@ public class FakeApi { public Mono testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -448,7 +458,7 @@ public class FakeApi { headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); if (enumFormStringArray != null) - formParams.add("enum_form_string_array", enumFormStringArray); + formParams.addAll("enum_form_string_array", enumFormStringArray); if (enumFormString != null) formParams.add("enum_form_string", enumFormString); @@ -462,7 +472,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Fake endpoint to test group parameters (optional) @@ -494,7 +504,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -519,7 +530,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * test inline additionalProperties @@ -536,7 +547,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); } - String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -553,7 +565,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * test json serialization of form data @@ -576,7 +588,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData"); } - String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -598,7 +611,7 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * @@ -639,7 +652,8 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); } - String path = UriComponentsBuilder.fromPath("/fake/test-query-paramters").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -660,6 +674,6 @@ public class FakeApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/test-query-paramters", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 2b52dd02f89..b6f694ab5f3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -61,7 +61,8 @@ public class FakeClassnameTags123Api { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname"); } - String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -80,6 +81,6 @@ public class FakeClassnameTags123Api { String[] authNames = new String[] { "api_key_query" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java index e919dfb88fe..d1b34d105c2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -63,7 +63,8 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet"); } - String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -80,7 +81,7 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/pet", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Deletes a pet @@ -100,9 +101,8 @@ public class PetApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("petId", petId); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -120,7 +120,7 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Finds Pets by status @@ -139,7 +139,8 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus"); } - String path = UriComponentsBuilder.fromPath("/pet/findByStatus").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -158,7 +159,7 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeFluxAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeFluxAPI("/pet/findByStatus", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Finds Pets by tags @@ -177,7 +178,8 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags"); } - String path = UriComponentsBuilder.fromPath("/pet/findByTags").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -196,7 +198,7 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeFluxAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeFluxAPI("/pet/findByTags", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Find pet by ID @@ -217,9 +219,8 @@ public class PetApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("petId", petId); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -236,7 +237,7 @@ public class PetApi { String[] authNames = new String[] { "api_key" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Update an existing pet @@ -256,7 +257,8 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet"); } - String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -273,7 +275,7 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/pet", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Updates a pet in the store with form data @@ -293,9 +295,8 @@ public class PetApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("petId", petId); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -317,7 +318,7 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * uploads an image @@ -338,9 +339,8 @@ public class PetApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImage").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("petId", petId); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -364,7 +364,7 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * uploads an image (required) @@ -390,9 +390,8 @@ public class PetApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/fake/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("petId", petId); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -416,6 +415,6 @@ public class PetApi { String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java index efe7fd58f56..364767217b6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -62,9 +62,8 @@ public class StoreApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("order_id", orderId); - String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("order_id", orderId); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -79,7 +78,7 @@ public class StoreApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Returns pet inventories by status @@ -91,7 +90,8 @@ public class StoreApi { public Mono> getInventory() throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -108,7 +108,7 @@ public class StoreApi { String[] authNames = new String[] { "api_key" }; ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Find purchase order by ID @@ -129,9 +129,8 @@ public class StoreApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("order_id", orderId); - String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("order_id", orderId); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -148,7 +147,7 @@ public class StoreApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Place an order for a pet @@ -167,7 +166,8 @@ public class StoreApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder"); } - String path = UriComponentsBuilder.fromPath("/store/order").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -184,6 +184,6 @@ public class StoreApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/store/order", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java index 71f334484a7..d884b800a38 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -60,7 +60,8 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser"); } - String path = UriComponentsBuilder.fromPath("/user").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -75,7 +76,7 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Creates list of users with given input array @@ -92,7 +93,8 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); } - String path = UriComponentsBuilder.fromPath("/user/createWithArray").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -107,7 +109,7 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Creates list of users with given input array @@ -124,7 +126,8 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput"); } - String path = UriComponentsBuilder.fromPath("/user/createWithList").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -139,7 +142,7 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Delete user @@ -158,9 +161,8 @@ public class UserApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("username", username); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -175,7 +177,7 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Get user by user name @@ -196,9 +198,8 @@ public class UserApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("username", username); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -215,7 +216,7 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Logs user into the system @@ -240,7 +241,8 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser"); } - String path = UriComponentsBuilder.fromPath("/user/login").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -260,7 +262,7 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user/login", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Logs out current logged in user session @@ -271,7 +273,8 @@ public class UserApi { public Mono logoutUser() throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/user/logout").build().toUriString(); + // create path and map variables + final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -286,7 +289,7 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** * Updated user @@ -311,9 +314,8 @@ public class UserApi { } // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + final Map pathParams = new HashMap(); + pathParams.put("username", username); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -328,6 +330,6 @@ public class UserApi { String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index f8c999df13b..0a0c651db0f 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js index e6cbc4e382c..ed2372325b4 100644 --- a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index face7cf6cf2..2ebf8220222 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js index eae522bf631..701fd3f97cb 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index c50e428399f..c4761653875 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index eb7d5a60a6c..5f59cda4fd3 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index fb070a51ef6..02a1258cc8b 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index db56a55b21f..2dcbc51dc7f 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js index 9774ac33999..52711df0c79 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js index 44c2f9b390c..b5488965b5e 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js index c1ad7844f52..45cd47e179f 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js index 2b19a95b486..a1326deae07 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js index 295febe3642..6b85a357e17 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js index f0b20ec0bbf..793d03f724a 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js index e2194051556..1dbe7d9c62d 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js index ce82a0e752a..be82c252870 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Animal.js b/samples/client/petstore/javascript-promise/src/model/Animal.js index b46bc005c75..8852638a310 100644 --- a/samples/client/petstore/javascript-promise/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise/src/model/Animal.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js index 5e9e0b16ee8..a69e3eeef32 100644 --- a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js index 13cae7cf90f..04384bef491 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js index a2a51049e71..fafd97e6d24 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js index 78739e4a4dc..f61e0d37552 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Capitalization.js b/samples/client/petstore/javascript-promise/src/model/Capitalization.js index ed0dc0b616a..9137cb539c0 100644 --- a/samples/client/petstore/javascript-promise/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise/src/model/Capitalization.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Cat.js b/samples/client/petstore/javascript-promise/src/model/Cat.js index fcc9e7bf670..5ae09a18916 100644 --- a/samples/client/petstore/javascript-promise/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise/src/model/Cat.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/CatAllOf.js b/samples/client/petstore/javascript-promise/src/model/CatAllOf.js index 78465ea099f..270517fc260 100644 --- a/samples/client/petstore/javascript-promise/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/CatAllOf.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Category.js b/samples/client/petstore/javascript-promise/src/model/Category.js index 10934470286..2594ddee37e 100644 --- a/samples/client/petstore/javascript-promise/src/model/Category.js +++ b/samples/client/petstore/javascript-promise/src/model/Category.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ClassModel.js b/samples/client/petstore/javascript-promise/src/model/ClassModel.js index 47e80df5421..d92ec1d65ec 100644 --- a/samples/client/petstore/javascript-promise/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise/src/model/ClassModel.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Client.js b/samples/client/petstore/javascript-promise/src/model/Client.js index ea7bfcafbae..5d75bdc72dc 100644 --- a/samples/client/petstore/javascript-promise/src/model/Client.js +++ b/samples/client/petstore/javascript-promise/src/model/Client.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Dog.js b/samples/client/petstore/javascript-promise/src/model/Dog.js index f69a203858a..467dbd080da 100644 --- a/samples/client/petstore/javascript-promise/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise/src/model/Dog.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/DogAllOf.js b/samples/client/petstore/javascript-promise/src/model/DogAllOf.js index a531669f537..3a290e36180 100644 --- a/samples/client/petstore/javascript-promise/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/DogAllOf.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js index 78fe939c4bf..118b94557f5 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumClass.js b/samples/client/petstore/javascript-promise/src/model/EnumClass.js index d4f668246b5..e371cf9ae89 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumTest.js b/samples/client/petstore/javascript-promise/src/model/EnumTest.js index 997ac55f5db..fbc216fcb83 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/File.js b/samples/client/petstore/javascript-promise/src/model/File.js index 109a6e55266..3aab2299143 100644 --- a/samples/client/petstore/javascript-promise/src/model/File.js +++ b/samples/client/petstore/javascript-promise/src/model/File.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js index 22f10496e4f..12f12337163 100644 --- a/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FormatTest.js b/samples/client/petstore/javascript-promise/src/model/FormatTest.js index 63b987b4394..aabebbfdd95 100644 --- a/samples/client/petstore/javascript-promise/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise/src/model/FormatTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js index a48fa374d98..10a3cadb5f6 100644 --- a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/List.js b/samples/client/petstore/javascript-promise/src/model/List.js index d27fdd125e4..764bf29e848 100644 --- a/samples/client/petstore/javascript-promise/src/model/List.js +++ b/samples/client/petstore/javascript-promise/src/model/List.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MapTest.js b/samples/client/petstore/javascript-promise/src/model/MapTest.js index aa9a1a5b4ea..9c5a7ea6d6e 100644 --- a/samples/client/petstore/javascript-promise/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise/src/model/MapTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index bc98f6da1fd..8460bb7bb80 100644 --- a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Model200Response.js b/samples/client/petstore/javascript-promise/src/model/Model200Response.js index 6ded236af20..1c9d623b582 100644 --- a/samples/client/petstore/javascript-promise/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise/src/model/Model200Response.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js index 1d19b387c30..9a6fa2cf9e8 100644 --- a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Name.js b/samples/client/petstore/javascript-promise/src/model/Name.js index c3e29dd84f7..f3e71c4228f 100644 --- a/samples/client/petstore/javascript-promise/src/model/Name.js +++ b/samples/client/petstore/javascript-promise/src/model/Name.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js index a51aff7a97b..596101634f3 100644 --- a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Order.js b/samples/client/petstore/javascript-promise/src/model/Order.js index 20f551b4e26..c422808114a 100644 --- a/samples/client/petstore/javascript-promise/src/model/Order.js +++ b/samples/client/petstore/javascript-promise/src/model/Order.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js index 2197245f64f..021068043d5 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js index ef94683a827..8879230e08e 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Pet.js b/samples/client/petstore/javascript-promise/src/model/Pet.js index 5f5c3e2b6f2..74ac05c4c07 100644 --- a/samples/client/petstore/javascript-promise/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise/src/model/Pet.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js index e5e7a71b4ba..45ad9ac7c7b 100644 --- a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js index 2ebce770f7e..965d7439ffe 100644 --- a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Tag.js b/samples/client/petstore/javascript-promise/src/model/Tag.js index 64a07da1a79..0fdca0f2acb 100644 --- a/samples/client/petstore/javascript-promise/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise/src/model/Tag.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js b/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js index 73386a84334..41910488d31 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js b/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js index b06faabd663..7e23e6edc6e 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js index 967d15b018d..17a20e40846 100644 --- a/samples/client/petstore/javascript-promise/src/model/User.js +++ b/samples/client/petstore/javascript-promise/src/model/User.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/XmlItem.js b/samples/client/petstore/javascript-promise/src/model/XmlItem.js index 244eb73f03a..5bf50e6ada8 100644 --- a/samples/client/petstore/javascript-promise/src/model/XmlItem.js +++ b/samples/client/petstore/javascript-promise/src/model/XmlItem.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/.openapi-generator/VERSION b/samples/client/petstore/javascript/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/javascript/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index e972c2b6887..76afd72759b 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js index 54709c871e0..9da91e314bf 100644 --- a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index 8990dbeb44a..fd0200d9830 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js index 8ef462bffc6..6f9fdb02c3b 100644 --- a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index 7af853c712a..2830ae8fc06 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 11ba830249e..5a3f5afb84b 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index a92872f7a33..761756dcc64 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index db56a55b21f..2dcbc51dc7f 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js index 9774ac33999..52711df0c79 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js index 44c2f9b390c..b5488965b5e 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js index c1ad7844f52..45cd47e179f 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js index 2b19a95b486..a1326deae07 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js index 295febe3642..6b85a357e17 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js index f0b20ec0bbf..793d03f724a 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js index e2194051556..1dbe7d9c62d 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js index ce82a0e752a..be82c252870 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index b46bc005c75..8852638a310 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ApiResponse.js b/samples/client/petstore/javascript/src/model/ApiResponse.js index 5e9e0b16ee8..a69e3eeef32 100644 --- a/samples/client/petstore/javascript/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript/src/model/ApiResponse.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js index 13cae7cf90f..04384bef491 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js index a2a51049e71..fafd97e6d24 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayTest.js b/samples/client/petstore/javascript/src/model/ArrayTest.js index 78739e4a4dc..f61e0d37552 100644 --- a/samples/client/petstore/javascript/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript/src/model/ArrayTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Capitalization.js b/samples/client/petstore/javascript/src/model/Capitalization.js index ed0dc0b616a..9137cb539c0 100644 --- a/samples/client/petstore/javascript/src/model/Capitalization.js +++ b/samples/client/petstore/javascript/src/model/Capitalization.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Cat.js b/samples/client/petstore/javascript/src/model/Cat.js index fcc9e7bf670..5ae09a18916 100644 --- a/samples/client/petstore/javascript/src/model/Cat.js +++ b/samples/client/petstore/javascript/src/model/Cat.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/CatAllOf.js b/samples/client/petstore/javascript/src/model/CatAllOf.js index 78465ea099f..270517fc260 100644 --- a/samples/client/petstore/javascript/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript/src/model/CatAllOf.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js index 10934470286..2594ddee37e 100644 --- a/samples/client/petstore/javascript/src/model/Category.js +++ b/samples/client/petstore/javascript/src/model/Category.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ClassModel.js b/samples/client/petstore/javascript/src/model/ClassModel.js index 47e80df5421..d92ec1d65ec 100644 --- a/samples/client/petstore/javascript/src/model/ClassModel.js +++ b/samples/client/petstore/javascript/src/model/ClassModel.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Client.js b/samples/client/petstore/javascript/src/model/Client.js index ea7bfcafbae..5d75bdc72dc 100644 --- a/samples/client/petstore/javascript/src/model/Client.js +++ b/samples/client/petstore/javascript/src/model/Client.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Dog.js b/samples/client/petstore/javascript/src/model/Dog.js index f69a203858a..467dbd080da 100644 --- a/samples/client/petstore/javascript/src/model/Dog.js +++ b/samples/client/petstore/javascript/src/model/Dog.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/DogAllOf.js b/samples/client/petstore/javascript/src/model/DogAllOf.js index a531669f537..3a290e36180 100644 --- a/samples/client/petstore/javascript/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript/src/model/DogAllOf.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumArrays.js b/samples/client/petstore/javascript/src/model/EnumArrays.js index 78fe939c4bf..118b94557f5 100644 --- a/samples/client/petstore/javascript/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript/src/model/EnumArrays.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js index d4f668246b5..e371cf9ae89 100644 --- a/samples/client/petstore/javascript/src/model/EnumClass.js +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumTest.js b/samples/client/petstore/javascript/src/model/EnumTest.js index 997ac55f5db..fbc216fcb83 100644 --- a/samples/client/petstore/javascript/src/model/EnumTest.js +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/File.js b/samples/client/petstore/javascript/src/model/File.js index 109a6e55266..3aab2299143 100644 --- a/samples/client/petstore/javascript/src/model/File.js +++ b/samples/client/petstore/javascript/src/model/File.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js index 22f10496e4f..12f12337163 100644 --- a/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FormatTest.js b/samples/client/petstore/javascript/src/model/FormatTest.js index 63b987b4394..aabebbfdd95 100644 --- a/samples/client/petstore/javascript/src/model/FormatTest.js +++ b/samples/client/petstore/javascript/src/model/FormatTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js index a48fa374d98..10a3cadb5f6 100644 --- a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/List.js b/samples/client/petstore/javascript/src/model/List.js index d27fdd125e4..764bf29e848 100644 --- a/samples/client/petstore/javascript/src/model/List.js +++ b/samples/client/petstore/javascript/src/model/List.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MapTest.js b/samples/client/petstore/javascript/src/model/MapTest.js index aa9a1a5b4ea..9c5a7ea6d6e 100644 --- a/samples/client/petstore/javascript/src/model/MapTest.js +++ b/samples/client/petstore/javascript/src/model/MapTest.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index bc98f6da1fd..8460bb7bb80 100644 --- a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js index 6ded236af20..1c9d623b582 100644 --- a/samples/client/petstore/javascript/src/model/Model200Response.js +++ b/samples/client/petstore/javascript/src/model/Model200Response.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ModelReturn.js b/samples/client/petstore/javascript/src/model/ModelReturn.js index 1d19b387c30..9a6fa2cf9e8 100644 --- a/samples/client/petstore/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript/src/model/ModelReturn.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index c3e29dd84f7..f3e71c4228f 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/NumberOnly.js b/samples/client/petstore/javascript/src/model/NumberOnly.js index a51aff7a97b..596101634f3 100644 --- a/samples/client/petstore/javascript/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript/src/model/NumberOnly.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Order.js b/samples/client/petstore/javascript/src/model/Order.js index 20f551b4e26..c422808114a 100644 --- a/samples/client/petstore/javascript/src/model/Order.js +++ b/samples/client/petstore/javascript/src/model/Order.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterComposite.js b/samples/client/petstore/javascript/src/model/OuterComposite.js index 2197245f64f..021068043d5 100644 --- a/samples/client/petstore/javascript/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript/src/model/OuterComposite.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterEnum.js b/samples/client/petstore/javascript/src/model/OuterEnum.js index ef94683a827..8879230e08e 100644 --- a/samples/client/petstore/javascript/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript/src/model/OuterEnum.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index 5f5c3e2b6f2..74ac05c4c07 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js index e5e7a71b4ba..45ad9ac7c7b 100644 --- a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js index 2ebce770f7e..965d7439ffe 100644 --- a/samples/client/petstore/javascript/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript/src/model/SpecialModelName.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js index 64a07da1a79..0fdca0f2acb 100644 --- a/samples/client/petstore/javascript/src/model/Tag.js +++ b/samples/client/petstore/javascript/src/model/Tag.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/TypeHolderDefault.js b/samples/client/petstore/javascript/src/model/TypeHolderDefault.js index 73386a84334..41910488d31 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderDefault.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/TypeHolderExample.js b/samples/client/petstore/javascript/src/model/TypeHolderExample.js index b06faabd663..7e23e6edc6e 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderExample.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index 967d15b018d..17a20e40846 100644 --- a/samples/client/petstore/javascript/src/model/User.js +++ b/samples/client/petstore/javascript/src/model/User.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/XmlItem.js b/samples/client/petstore/javascript/src/model/XmlItem.js index 244eb73f03a..5bf50e6ada8 100644 --- a/samples/client/petstore/javascript/src/model/XmlItem.js +++ b/samples/client/petstore/javascript/src/model/XmlItem.js @@ -7,7 +7,11 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x * * Do not edit the class manually. * diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator-ignore b/samples/client/petstore/kotlin-gson/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION new file mode 100644 index 00000000000..e4955748d3e --- /dev/null +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/README.md b/samples/client/petstore/kotlin-gson/README.md new file mode 100644 index 00000000000..aef4ea15bee --- /dev/null +++ b/samples/client/petstore/kotlin-gson/README.md @@ -0,0 +1,90 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-gson/build.gradle b/samples/client/petstore/kotlin-gson/build.gradle new file mode 100644 index 00000000000..2b975060242 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/build.gradle @@ -0,0 +1,36 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.50' + + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/client/petstore/kotlin-gson/docs/ApiResponse.md b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md new file mode 100644 index 00000000000..6b4c6bf2779 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-gson/docs/Category.md b/samples/client/petstore/kotlin-gson/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-gson/docs/Order.md b/samples/client/petstore/kotlin-gson/docs/Order.md new file mode 100644 index 00000000000..ef31dbf2f4f --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-gson/docs/Pet.md b/samples/client/petstore/kotlin-gson/docs/Pet.md new file mode 100644 index 00000000000..ec775600737 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-gson/docs/PetApi.md b/samples/client/petstore/kotlin-gson/docs/PetApi.md new file mode 100644 index 00000000000..ea93e174527 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/PetApi.md @@ -0,0 +1,405 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val body : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(body) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val body : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(body) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-gson/docs/StoreApi.md new file mode 100644 index 00000000000..f4986041af8 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val body : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-gson/docs/Tag.md b/samples/client/petstore/kotlin-gson/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-gson/docs/User.md b/samples/client/petstore/kotlin-gson/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-gson/docs/UserApi.md b/samples/client/petstore/kotlin-gson/docs/UserApi.md new file mode 100644 index 00000000000..0f55f06bc62 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val body : User = // User | Created user object +try { + apiInstance.createUser(body) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val body : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(body) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val body : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(body) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val body : User = // User | Updated user object +try { + apiInstance.updateUser(username, body) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-gson/pom.xml b/samples/client/petstore/kotlin-gson/pom.xml new file mode 100644 index 00000000000..46e3845d39b --- /dev/null +++ b/samples/client/petstore/kotlin-gson/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + io.swagger + KotlinGsonPetstoreClientTests + pom + 1.0-SNAPSHOT + Kotlin Gson Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/samples/client/petstore/kotlin-gson/settings.gradle b/samples/client/petstore/kotlin-gson/settings.gradle new file mode 100644 index 00000000000..207bc66a067 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-gson' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..5eabd2dbcb4 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,318 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("status", toMultiValue(status.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("tags", toMultiValue(tags.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetById(petId: kotlin.Long) : Pet { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..8f24aeabaaf --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,168 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Order + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrder(orderId: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventory() : kotlin.collections.Map { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderById(orderId: kotlin.Long) : Order { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrder(body: Order) : Order { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..db099377b83 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,309 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUser(body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUser(username: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByName(username: kotlin.String) : User { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("username", listOf(username.toString())) + put("password", listOf(password.toString())) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs out current logged in user session + * + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUser() : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUser(username: kotlin.String, body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..ca294b411c8 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,172 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.asRequestBody +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.FormBody +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull +import okhttp3.ResponseBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.Request +import java.io.File + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val Authorization = "Authorization" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + val apiKey: MutableMap = mutableMapOf() + val apiKeyPrefix: MutableMap = mutableMapOf() + var username: String? = null + var password: String? = null + var accessToken: String? = null + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> content.asRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> Serializer.gson.toJson(content, T::class.java).toRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.gson.fromJson(bodyContent, T::class.java) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun updateAuthParams(requestConfig: RequestConfig) { + if (requestConfig.headers["api_key"].isNullOrEmpty()) { + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! + } else { + requestConfig.headers["api_key"] = apiKey["api_key"]!! + } + } + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + accessToken?.let { accessToken -> + requestConfig.headers[Authorization] = "Bearer " + accessToken + } + } + } + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") + + // take authMethod from operation + updateAuthParams(requestConfig) + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code, + response.headers.toMultimap() + ) + response.isInformational -> return Informational( + response.message, + response.code, + response.headers.toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body, accept), + response.code, + response.headers.toMultimap() + ) + response.isClientError -> return ClientError( + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + else -> return ServerError( + null, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + } + } +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 00000000000..f1a8aecc914 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +abstract class ApiInfrastructureResponse(val responseType: ResponseType) { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 00000000000..dd34bd48b2c --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..6120b081929 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 00000000000..c5d330ac075 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: Date?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): Date? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return formatter.parse(out.nextString()) + } + } + } +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..2f3b0157ba7 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,42 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException : RuntimeException { + + /** + * Constructs an [ClientException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ClientException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException : RuntimeException { + + /** + * Constructs an [ServerException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ServerException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..30ef6697183 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..3ad781c66ca --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..9c22257e223 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..931b12b8bd7 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 00000000000..69b562becb0 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..a81be094f41 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gson: Gson = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(UUID::class.java, UUIDAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + .create() +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 00000000000..04dce98308e --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,34 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.util.UUID + +class UUIDAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: UUID?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(value.toString()) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): UUID? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return UUID.fromString(out.nextString()) + } + } + } +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 00000000000..96b24b0b2b2 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + @SerializedName("code") + val code: kotlin.Int? = null, + @SerializedName("type") + val type: kotlin.String? = null, + @SerializedName("message") + val message: kotlin.String? = null +) + + + diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..d0af4fb050b --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,30 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +/** + * A category for a pet + * @param id + * @param name + */ + +data class Category ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("name") + val name: kotlin.String? = null +) + + + diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..ac55ce97d53 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("petId") + val petId: kotlin.Long? = null, + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + @SerializedName("shipDate") + val shipDate: java.time.LocalDateTime? = null, + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + @SerializedName("complete") + val complete: kotlin.Boolean? = null +) + + +{ + /** + * Order Status + * Values: placed,approved,delivered + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value="placed") placed("placed"), + @SerializedName(value="approved") approved("approved"), + @SerializedName(value="delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..c9c7e0d8f1e --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,57 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +/** + * A pet for sale in the pet store + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("photoUrls") + val photoUrls: kotlin.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @SerializedName("status") + val status: Pet.Status? = null +) + + +{ + /** + * pet status in the store + * Values: available,pending,sold + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value="available") available("available"), + @SerializedName(value="pending") pending("pending"), + @SerializedName(value="sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..484f3db87cd --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,30 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +/** + * A tag for a pet + * @param id + * @param name + */ + +data class Tag ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("name") + val name: kotlin.String? = null +) + + + diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..4a660298d73 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,49 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("username") + val username: kotlin.String? = null, + @SerializedName("firstName") + val firstName: kotlin.String? = null, + @SerializedName("lastName") + val lastName: kotlin.String? = null, + @SerializedName("email") + val email: kotlin.String? = null, + @SerializedName("password") + val password: kotlin.String? = null, + @SerializedName("phone") + val phone: kotlin.String? = null, + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null +) + + + diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION index d168f1d8bda..e4955748d3e 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/build.gradle b/samples/client/petstore/kotlin-nonpublic/build.gradle index 98ac4f243e6..d2b39bf5e9f 100644 --- a/samples/client/petstore/kotlin-nonpublic/build.gradle +++ b/samples/client/petstore/kotlin-nonpublic/build.gradle @@ -7,7 +7,7 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.50' repositories { mavenCentral() @@ -32,6 +32,6 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile "com.squareup.moshi:moshi-kotlin:1.8.0" compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:4.2.0" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/client/petstore/kotlin-nonpublic/pom.xml b/samples/client/petstore/kotlin-nonpublic/pom.xml new file mode 100644 index 00000000000..2b400e564b9 --- /dev/null +++ b/samples/client/petstore/kotlin-nonpublic/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + io.swagger + KotlinNonpublicPetstoreClientTests + pom + 1.0-SNAPSHOT + Kotlin Nonpublic Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index edce99a2128..ed683e3a093 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -48,17 +48,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -83,17 +83,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -121,17 +121,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -159,17 +159,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -194,17 +194,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -228,17 +228,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -264,17 +264,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -301,17 +301,17 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 46b6b316d95..9c448c5bd18 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -47,17 +47,17 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2 query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2 query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -116,17 +116,17 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2 query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -151,17 +151,17 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2 query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 4b289be0dcd..da7eda47fea 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -47,17 +47,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -115,17 +115,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -149,17 +149,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -184,17 +184,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -224,17 +224,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -257,17 +257,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -292,17 +292,17 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2" query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 6f180df2254..d26cda9091c 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -1,6 +1,6 @@ package org.openapitools.client.infrastructure -typealias MultiValueMap = MutableMap> +internal typealias MultiValueMap = MutableMap> internal fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 8e1cefd2485..86bcb51fba6 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ internal class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator-ignore b/samples/client/petstore/kotlin-nullable/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION new file mode 100644 index 00000000000..e4955748d3e --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/README.md b/samples/client/petstore/kotlin-nullable/README.md new file mode 100644 index 00000000000..aef4ea15bee --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/README.md @@ -0,0 +1,90 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-nullable/build.gradle b/samples/client/petstore/kotlin-nullable/build.gradle new file mode 100644 index 00000000000..d2b39bf5e9f --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/build.gradle @@ -0,0 +1,37 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.50' + + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "com.squareup.moshi:moshi-kotlin:1.8.0" + compile "com.squareup.moshi:moshi-adapters:1.8.0" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md new file mode 100644 index 00000000000..6b4c6bf2779 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-nullable/docs/Category.md b/samples/client/petstore/kotlin-nullable/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-nullable/docs/Order.md b/samples/client/petstore/kotlin-nullable/docs/Order.md new file mode 100644 index 00000000000..ef31dbf2f4f --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-nullable/docs/Pet.md b/samples/client/petstore/kotlin-nullable/docs/Pet.md new file mode 100644 index 00000000000..ec775600737 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-nullable/docs/PetApi.md b/samples/client/petstore/kotlin-nullable/docs/PetApi.md new file mode 100644 index 00000000000..b9337d3d62a --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/PetApi.md @@ -0,0 +1,405 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val body : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(body) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array? = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array? = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet? = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val body : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(body) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse? = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md new file mode 100644 index 00000000000..63391018afb --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map? = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order? = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val body : Order = // Order | order placed for purchasing the pet +try { + val result : Order? = apiInstance.placeOrder(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-nullable/docs/Tag.md b/samples/client/petstore/kotlin-nullable/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-nullable/docs/User.md b/samples/client/petstore/kotlin-nullable/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-nullable/docs/UserApi.md b/samples/client/petstore/kotlin-nullable/docs/UserApi.md new file mode 100644 index 00000000000..57f651f0b12 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val body : User = // User | Created user object +try { + apiInstance.createUser(body) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val body : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(body) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val body : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(body) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User? = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String? = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val body : User = // User | Updated user object +try { + apiInstance.updateUser(username, body) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-nullable/settings.gradle b/samples/client/petstore/kotlin-nullable/settings.gradle new file mode 100644 index 00000000000..1022b496fed --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-nullable' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..6f9d73ae06e --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,318 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.Array or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatus(status: kotlin.Array) : kotlin.Array? { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("status", toMultiValue(status.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.Array or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByTags(tags: kotlin.Array) : kotlin.Array? { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("tags", toMultiValue(tags.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetById(petId: kotlin.Long) : Pet? { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..145423ba0b2 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,168 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Order + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrder(orderId: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventory() : kotlin.collections.Map? { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderById(orderId: kotlin.Long) : Order? { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrder(body: Order) : Order? { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..1f8df9953b1 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,309 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUser(body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUser(username: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByName(username: kotlin.String) : User? { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String or null + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("username", listOf(username.toString())) + put("password", listOf(password.toString())) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String? + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs out current logged in user session + * + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUser() : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUser(username: kotlin.String, body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..443c18a8353 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,172 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.asRequestBody +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.FormBody +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull +import okhttp3.ResponseBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.Request +import java.io.File + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val Authorization = "Authorization" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + val apiKey: MutableMap = mutableMapOf() + val apiKeyPrefix: MutableMap = mutableMapOf() + var username: String? = null + var password: String? = null + var accessToken: String? = null + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> content.asRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun updateAuthParams(requestConfig: RequestConfig) { + if (requestConfig.headers["api_key"].isNullOrEmpty()) { + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! + } else { + requestConfig.headers["api_key"] = apiKey["api_key"]!! + } + } + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + accessToken?.let { accessToken -> + requestConfig.headers[Authorization] = "Bearer " + accessToken + } + } + } + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") + + // take authMethod from operation + updateAuthParams(requestConfig) + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code, + response.headers.toMultimap() + ) + response.isInformational -> return Informational( + response.message, + response.code, + response.headers.toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body, accept), + response.code, + response.headers.toMultimap() + ) + response.isClientError -> return ClientError( + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + else -> return ServerError( + null, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + } + } +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 00000000000..51c1f14b2a8 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +abstract class ApiInfrastructureResponse(val responseType: ResponseType) { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T?, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 00000000000..dd34bd48b2c --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..ff5e2a81ee8 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson + +class ByteArrayAdapter { + @ToJson + fun toJson(data: ByteArray): String = String(data) + + @FromJson + fun fromJson(data: String): ByteArray = data.toByteArray() +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..2f3b0157ba7 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,42 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException : RuntimeException { + + /** + * Constructs an [ClientException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ClientException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException : RuntimeException { + + /** + * Constructs an [ServerException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ServerException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..b2e1654479a --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..e082db94811 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..9c22257e223 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..931b12b8bd7 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 00000000000..69b562becb0 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..7c5a353e0f7 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +import java.util.Date + +object Serializer { + @JvmStatic + val moshi: Moshi = Moshi.Builder() + .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(KotlinJsonAdapterFactory()) + .build() +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 00000000000..a4a44cc18b7 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String) = UUID.fromString(s) +} diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 00000000000..8d5c8448f04 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import java.io.Serializable +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + @Json(name = "code") + val code: kotlin.Int? = null, + @Json(name = "type") + val type: kotlin.String? = null, + @Json(name = "message") + val message: kotlin.String? = null +) +: Serializable + +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} + diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..7895d7627ab --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import java.io.Serializable +/** + * A category for a pet + * @param id + * @param name + */ + +data class Category ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) +: Serializable + +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} + diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..47862cfb7b6 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import java.io.Serializable +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "petId") + val petId: kotlin.Long? = null, + @Json(name = "quantity") + val quantity: kotlin.Int? = null, + @Json(name = "shipDate") + val shipDate: java.time.LocalDateTime? = null, + /* Order Status */ + @Json(name = "status") + val status: Order.Status? = null, + @Json(name = "complete") + val complete: kotlin.Boolean? = null +) +: Serializable + +{ + companion object { + private const val serialVersionUID: Long = 123 + } + /** + * Order Status + * Values: placed,approved,delivered + */ + + enum class Status(val value: kotlin.String){ + @Json(name = "placed") placed("placed"), + @Json(name = "approved") approved("approved"), + @Json(name = "delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..2f0e9aecfc1 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,61 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.squareup.moshi.Json +import java.io.Serializable +/** + * A pet for sale in the pet store + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + @Json(name = "name") + val name: kotlin.String, + @Json(name = "photoUrls") + val photoUrls: kotlin.Array, + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "category") + val category: Category? = null, + @Json(name = "tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @Json(name = "status") + val status: Pet.Status? = null +) +: Serializable + +{ + companion object { + private const val serialVersionUID: Long = 123 + } + /** + * pet status in the store + * Values: available,pending,sold + */ + + enum class Status(val value: kotlin.String){ + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..7fb74357125 --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import java.io.Serializable +/** + * A tag for a pet + * @param id + * @param name + */ + +data class Tag ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) +: Serializable + +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} + diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..e66f3cf09fe --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import java.io.Serializable +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "username") + val username: kotlin.String? = null, + @Json(name = "firstName") + val firstName: kotlin.String? = null, + @Json(name = "lastName") + val lastName: kotlin.String? = null, + @Json(name = "email") + val email: kotlin.String? = null, + @Json(name = "password") + val password: kotlin.String? = null, + @Json(name = "phone") + val phone: kotlin.String? = null, + /* User Status */ + @Json(name = "userStatus") + val userStatus: kotlin.Int? = null +) +: Serializable + +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} + diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION index d168f1d8bda..e4955748d3e 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/build.gradle b/samples/client/petstore/kotlin-okhttp3/build.gradle index c3a555eaaed..7272e8785fe 100644 --- a/samples/client/petstore/kotlin-okhttp3/build.gradle +++ b/samples/client/petstore/kotlin-okhttp3/build.gradle @@ -7,7 +7,7 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.50' repositories { mavenCentral() @@ -32,6 +32,6 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile "com.squareup.moshi:moshi-kotlin:1.8.0" compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:3.12.4" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + compile "com.squareup.okhttp3:okhttp:3.12.6" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index bc3e77dbf5f..5eabd2dbcb4 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -48,17 +48,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -83,17 +83,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -121,17 +121,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -159,17 +159,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -194,17 +194,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -228,17 +228,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -264,17 +264,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -301,17 +301,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 086f39cc5e7..8f24aeabaaf 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -47,17 +47,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -116,17 +116,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -151,17 +151,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 0e22814d9de..db099377b83 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -47,17 +47,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -115,17 +115,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -149,17 +149,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -184,17 +184,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -224,17 +224,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -257,17 +257,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -292,17 +292,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 617ac3fe906..ff5e2a81ee8 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/kotlin-string/build.gradle b/samples/client/petstore/kotlin-string/build.gradle index 98ac4f243e6..d2b39bf5e9f 100644 --- a/samples/client/petstore/kotlin-string/build.gradle +++ b/samples/client/petstore/kotlin-string/build.gradle @@ -7,7 +7,7 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.50' repositories { mavenCentral() @@ -32,6 +32,6 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile "com.squareup.moshi:moshi-kotlin:1.8.0" compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:4.2.0" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index bc3e77dbf5f..5eabd2dbcb4 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -48,17 +48,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -83,17 +83,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -121,17 +121,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -159,17 +159,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -194,17 +194,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -228,17 +228,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -264,17 +264,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -301,17 +301,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 086f39cc5e7..8f24aeabaaf 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -47,17 +47,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -116,17 +116,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -151,17 +151,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 0e22814d9de..db099377b83 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -47,17 +47,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -115,17 +115,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -149,17 +149,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -184,17 +184,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -224,17 +224,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -257,17 +257,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -292,17 +292,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 617ac3fe906..ff5e2a81ee8 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/kotlin-threetenbp/build.gradle b/samples/client/petstore/kotlin-threetenbp/build.gradle index 6ec6192162b..613a199fea5 100644 --- a/samples/client/petstore/kotlin-threetenbp/build.gradle +++ b/samples/client/petstore/kotlin-threetenbp/build.gradle @@ -7,7 +7,7 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.50' repositories { mavenCentral() @@ -32,7 +32,7 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile "com.squareup.moshi:moshi-kotlin:1.8.0" compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:4.2.0" + compile "com.squareup.okhttp3:okhttp:4.2.2" compile "org.threeten:threetenbp:1.4.0" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index bc3e77dbf5f..5eabd2dbcb4 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -48,17 +48,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -83,17 +83,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -121,17 +121,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -159,17 +159,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -194,17 +194,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -228,17 +228,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -264,17 +264,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -301,17 +301,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 086f39cc5e7..8f24aeabaaf 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -47,17 +47,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -116,17 +116,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -151,17 +151,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 0e22814d9de..db099377b83 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -47,17 +47,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -115,17 +115,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -149,17 +149,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -184,17 +184,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -224,17 +224,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -257,17 +257,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -292,17 +292,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 617ac3fe906..ff5e2a81ee8 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/kotlin/build.gradle b/samples/client/petstore/kotlin/build.gradle index 98ac4f243e6..d2b39bf5e9f 100644 --- a/samples/client/petstore/kotlin/build.gradle +++ b/samples/client/petstore/kotlin/build.gradle @@ -7,7 +7,7 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.50' repositories { mavenCentral() @@ -32,6 +32,6 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile "com.squareup.moshi:moshi-kotlin:1.8.0" compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:4.2.0" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index bc3e77dbf5f..5eabd2dbcb4 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -48,17 +48,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -83,17 +83,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -121,17 +121,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -159,17 +159,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -194,17 +194,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -228,17 +228,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -264,17 +264,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -301,17 +301,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 086f39cc5e7..8f24aeabaaf 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -47,17 +47,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -116,17 +116,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -151,17 +151,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 0e22814d9de..db099377b83 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -47,17 +47,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -81,17 +81,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -115,17 +115,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -149,17 +149,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -184,17 +184,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -224,17 +224,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -257,17 +257,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } @@ -292,17 +292,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 617ac3fe906..ff5e2a81ee8 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/client/petstore/nim/.openapi-generator/VERSION b/samples/client/petstore/nim/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/client/petstore/nim/.openapi-generator/VERSION +++ b/samples/client/petstore/nim/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/client/petstore/ocaml/.openapi-generator/VERSION b/samples/client/petstore/ocaml/.openapi-generator/VERSION index 83a328a9227..e4955748d3e 100644 --- a/samples/client/petstore/ocaml/.openapi-generator/VERSION +++ b/samples/client/petstore/ocaml/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ocaml/README.md b/samples/client/petstore/ocaml/README.md index caa98287d45..e7055fe61f7 100644 --- a/samples/client/petstore/ocaml/README.md +++ b/samples/client/petstore/ocaml/README.md @@ -16,7 +16,7 @@ OCaml 4.x Please run the following commands to build the package `petstore_client`: ```sh -opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix +opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix pin ocaml-migrate-parsetree 1.3.1 eval $(opam env) dune build ``` diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 30e6dfe67aa..e7bca0d4a76 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 9c61ac95f7c..a42120c0fc9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 1b91938ffa5..cc51466fe8d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index e7293c4ec87..219309bce2b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 324df90cc52..850ebc7a6b0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 1b32db09a86..5344837e71b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 83dd6134b73..8e14af2f5fd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 5942ddea291..2776e68dcf7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 31036ed2c24..649899abc0a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php index 65bc49f7328..1a799447039 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php index d408428d783..4d0ee820c81 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php index 815fb828c80..3b02db77cd2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 3dd4d15fd3f..d3f7e91e94a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php index 530b03800dd..66ed664ab7e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php index 2c3b9c7a3e3..ef3acc1818e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php index a584aa2452a..53312eb7362 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php index 9ca047ee12a..ddd025c6fe4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index db94841581b..b59f68fd3c3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 9b72d9ffe51..e8ff5c058f6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 11244ecfb20..9d31d3cb6cf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 32c44dd7df8..2ab6e831489 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 011f4a5e87f..aa2188451a1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index fee455fefb7..15aea154e89 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index ea464ecb3d4..6a5e6d4c417 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index af85243996e..44446bc5e1b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 73864723cc1..709bfb60385 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 0fc47ff2546..69be17a86bf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index a4584628076..eaafe43ceb0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index de27e21800e..fcfa69fa6d9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 90d3768d64b..b024829f263 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index a18c5b38c08..9e7be64a8ab 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 4821949ea07..0546491c4bc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 0bedaa28cd4..42f272970f6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index d6601083280..e88decfd1e4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 27324041b2b..584633e3029 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index d625375e496..f99b05efcbd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 5d0fac0c830..253755fc056 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 77e3656df58..94b7f7abfc9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 7e05ebd4901..8dacfce0348 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 4627a69ab52..fa1b81a986b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 79bcab1ca93..90427e76d18 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 8bfec03077d..642ae73593a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 5661524ff9d..f0173a5f6cf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 490c7609775..e3be40ba9a0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 17f4844d3b4..3beb50bc5e1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 2fc6eaa6c8a..babd96f5204 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index fc26df1dd1b..ebd0445b2f1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 84e8aa75203..6baa08af61d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index c3cde4e2da0..d354c76f413 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 32db4a51955..8bae1a41f53 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index cbe57ec720a..55e7c00ae4b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index b04e3a085d6..60e444027ce 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php index 73b8a09f561..9123dcb2c59 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php index aa4dc8442fe..521b009544c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 781971035b6..af838827448 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php index 6a8b37c7127..e0a4e09365b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index fc8db7b3164..9f114e8c23a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index f7ebb34cc98..cd3600211df 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index 588a0cbf8b1..6ae593b427a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index 25ee8db1019..8722589a0e1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index 49a00a98ae0..4d1f976a0c0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index 9e1ca342942..427e1bb4a75 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 036f9d0fce7..56e08cda3d4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php index 8daebca96f6..b9a4d3f6e11 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php index a02060cd31e..6a90c32e300 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php index a859f118bc4..392d9368c62 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index 0deed6ba84a..0f9dda74d52 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php index a2ad19f3a67..318b40f89cc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php index adbb587d9c6..2eea21f5ef6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php index cb978d8260c..d86910124f5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php index 9086aac5dd0..201ef3bd620 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index 22b4da20273..a932ae2c350 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index 769fb143806..eadf4e4960a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 3888a2acbca..50e79c1e8da 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 01739a814f1..1cb2acfe13f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 091dbcd8411..dabf6d30c29 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index 48852ba5569..58b6bd9c728 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php index 93093478e70..876e8af23f0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 53f1a0aa495..a0a8f88bb1f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index ae8a8b25643..676d136f2a8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index cc76f2903b3..b10ccc2633a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index 2cf80044760..f0436323682 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php index 0f6f81ae75a..6c4af217095 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index 95946267855..459f2554f36 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 970a127d253..26e402ccc3f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index 79b5918d80a..765d6441c57 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 8cbc69bb7b3..a47fb2bcb6f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 3cc7df9e6e3..40f897793e1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index 86b34f5ccad..d645228eb5e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index e5911434956..c29b4c02cc2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 68a4b0dc43a..8943413aeb7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 42ddddff86c..907943e72a8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index d9c8a9bb5a2..db82691faf1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index 5fcb6299065..d27201d14ff 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index f6fd81b3ca1..36044796328 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index 4c9c784f628..aee1ec18ca4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 02232a6d164..18217c27cd9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index d89a2460ced..74ff1744302 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index aefed931c95..5847eec7b34 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 3d409221454..a6bf66d5933 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index ac3865d7311..18ceb4699ed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index 975ea9134d5..e971fe38753 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index a3d27b5bd41..45acbd3770a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index 2b42e29c51a..bc0494ff301 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index f375ba8096d..ac46a57daec 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php index 15bbe96a104..306b8c88a8c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php index 8bf77c7c2ba..a1036a377e9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 9672d99f1e7..745ea56d0ad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php index 4b7f555c896..f41e94183e0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 9ad41e84f6d..24b99a2946f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -622,11 +622,11 @@ class ApiClient(object): return data kwargs = {} - if klass.openapi_types is not None: + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): + if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index ae776ad8c4e..fa90c926dee 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -12,7 +12,6 @@ from __future__ import absolute_import -import copy import logging import sys import urllib3 @@ -21,21 +20,7 @@ import six from six.moves import http_client as httplib -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls, **kwargs): - if cls._default is None: - cls._default = type.__call__(cls, **kwargs) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -49,7 +34,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """ def __init__(self, host="http://petstore.swagger.io:80/v2", - api_key={}, api_key_prefix={}, + api_key=None, api_key_prefix=None, username="", password=""): """Constructor """ @@ -60,10 +45,14 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """Temp file folder for downloading files """ # Authentication Settings - self.api_key = api_key + self.api_key = {} + if api_key: + self.api_key = api_key """dict to store API key(s) """ - self.api_key_prefix = api_key_prefix + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None diff --git a/samples/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/client/petstore/python-experimental/.openapi-generator/VERSION index c3a2c7076fa..bfbf77eb7fa 100644 --- a/samples/client/petstore/python-experimental/.openapi-generator/VERSION +++ b/samples/client/petstore/python-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 3cfe1c3ecc8..6673889b51f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -339,18 +339,19 @@ class ApiClient(object): _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, _check_type) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - return thread + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 5e9d7b5d41d..9a0c95c9045 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -12,7 +12,6 @@ from __future__ import absolute_import -import copy import logging import multiprocessing import sys @@ -22,21 +21,7 @@ import six from six.moves import http_client as httplib -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls, **kwargs): - if cls._default is None: - cls._default = type.__call__(cls, **kwargs) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -50,7 +35,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """ def __init__(self, host="http://petstore.swagger.io:80/v2", - api_key={}, api_key_prefix={}, + api_key=None, api_key_prefix=None, username="", password=""): """Constructor """ @@ -61,10 +46,14 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """Temp file folder for downloading files """ # Authentication Settings - self.api_key = api_key + self.api_key = {} + if api_key: + self.api_key = api_key """dict to store API key(s) """ - self.api_key_prefix = api_key_prefix + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index bd360c4b05f..0d1075ffe97 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -624,11 +624,11 @@ class ApiClient(object): return data kwargs = {} - if klass.openapi_types is not None: + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): + if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 5e9d7b5d41d..9a0c95c9045 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -12,7 +12,6 @@ from __future__ import absolute_import -import copy import logging import multiprocessing import sys @@ -22,21 +21,7 @@ import six from six.moves import http_client as httplib -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls, **kwargs): - if cls._default is None: - cls._default = type.__call__(cls, **kwargs) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -50,7 +35,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """ def __init__(self, host="http://petstore.swagger.io:80/v2", - api_key={}, api_key_prefix={}, + api_key=None, api_key_prefix=None, username="", password=""): """Constructor """ @@ -61,10 +46,14 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """Temp file folder for downloading files """ # Authentication Settings - self.api_key = api_key + self.api_key = {} + if api_key: + self.api_key = api_key """dict to store API key(s) """ - self.api_key_prefix = api_key_prefix + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 5e7a95a35f3..46e568df26a 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -622,11 +622,11 @@ class ApiClient(object): return data kwargs = {} - if klass.openapi_types is not None: + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): + if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 5e9d7b5d41d..9a0c95c9045 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -12,7 +12,6 @@ from __future__ import absolute_import -import copy import logging import multiprocessing import sys @@ -22,21 +21,7 @@ import six from six.moves import http_client as httplib -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls, **kwargs): - if cls._default is None: - cls._default = type.__call__(cls, **kwargs) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -50,7 +35,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """ def __init__(self, host="http://petstore.swagger.io:80/v2", - api_key={}, api_key_prefix={}, + api_key=None, api_key_prefix=None, username="", password=""): """Constructor """ @@ -61,10 +46,14 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """Temp file folder for downloading files """ # Authentication Settings - self.api_key = api_key + self.api_key = {} + if api_key: + self.api_key = api_key """dict to store API key(s) """ - self.api_key_prefix = api_key_prefix + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None diff --git a/samples/client/petstore/python/tests/test_configuration.py b/samples/client/petstore/python/tests/test_configuration.py new file mode 100644 index 00000000000..f1074b17e70 --- /dev/null +++ b/samples/client/petstore/python/tests/test_configuration.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestConfiguration(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConfiguration(self): + # check that different instances use different dictionaries + c1 = petstore_api.Configuration() + c2 = petstore_api.Configuration() + assert id(c1.api_key) != id(c2.api_key) + assert id(c1.api_key_prefix) != id(c2.api_key_prefix) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 4740de936c9..3b5efd4fbf8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index bf8e6ebded5..4578d49eb7f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index edee7bd2ae5..b21080137c2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index b266f097747..151699cbc8a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 1f6c48a31cd..aefd871f6e6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 5e510a6c7e0..62b370a47ea 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 30d0aff9129..368cca4a3f0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index d4f4e7c7e39..13d372ffcbd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 337c5c7002c..a7913fc0eac 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 4c733db3185..a9e64da0508 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb index 2796cc1037b..067a0612917 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb index f5777264268..f0d9329994f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb index ad463ebcb4b..420d2b87bea 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 1842fd48144..7217e23e904 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -70,6 +74,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -275,7 +285,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb index 3a3f4bae412..52ad58881fc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb index 9558c78e7a4..6896d8d4ea9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb index 8b0583e4fef..626a5e509fe 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb index 2718038deb9..45c8bd07cd9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index f12f35a3fb9..b37131fafff 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +200,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 45322966bc5..17ed8749bf8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index cabaf4e8cad..abe18d148f9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index a285dd3e898..327dfd46785 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index cb66978d710..c1a31f16f62 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +203,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index ae6779e93d1..399c8bdd44c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -51,6 +55,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +225,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 8bc81970c33..cc5c575d064 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 1f825aad892..3fbd9b9d124 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 841876180d7..1d5afc07c6b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +195,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 8fe3f0f3d6e..15a04a17c37 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 52f71511b6e..bcffca51c01 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index a94a6581d0f..faaf2b31576 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 8bedfe83840..4b62f47a316 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 6499e6c9384..571a34c7bf4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -56,6 +60,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +224,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 69fcebec615..05f483dc231 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index a4aabb4854d..90e58848ed1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -68,6 +72,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -280,7 +290,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 62814e28236..a3db6ff30a4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -32,6 +36,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 0cfd2a0bafe..e3973cec448 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index dbd40a5ac05..87ec413718d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -82,6 +86,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -496,7 +506,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index f5bd2b3e5a9..265ee1ff62e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 2de84143b82..da3d106562c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 262374d278a..8297b2d2f87 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -64,6 +68,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +236,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 0fca26bc281..efd27371fc8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +199,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 7633a6473a1..76f11306d03 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -35,6 +39,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +189,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 96803b3cfca..9af9e5faa42 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index cc7b5f5f720..b451763c1f8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -43,6 +47,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +212,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index e22793a2ca1..ba25075f199 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index 30082ec0207..182a75d3b39 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +261,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index e5a4dbbf7ff..f682dda3ef7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index d7c1b931b97..75f90f6ef0d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index aded7da65e0..56562092d66 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +273,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index bac38b69abc..75e13ee53da 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 12fec5a6901..98f72128730 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 7e89b7db239..30c3c0d1474 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb index 410967ec5b3..d2565f65e66 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -46,6 +50,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -236,7 +246,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb index c5af7812391..36d3cbb0451 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -50,6 +54,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -246,7 +256,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index ea5a393bead..bb73fcccac1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -59,6 +63,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +243,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb index 60698d77ece..b57ac3901de 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -142,6 +146,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -439,7 +449,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index fba2068c04d..639fff79857 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 9ec5502dc6a..8a35f17b52c 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 4740de936c9..3b5efd4fbf8 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index bf8e6ebded5..4578d49eb7f 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index edee7bd2ae5..b21080137c2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index b266f097747..151699cbc8a 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 1f6c48a31cd..aefd871f6e6 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 5e510a6c7e0..62b370a47ea 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 30d0aff9129..368cca4a3f0 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index a9d41cb9af9..3be93ca19ff 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index 337c5c7002c..a7913fc0eac 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index ca4eb24ee9e..2de8dacf644 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb index 2796cc1037b..067a0612917 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb index f5777264268..f0d9329994f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb index ad463ebcb4b..420d2b87bea 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 1842fd48144..7217e23e904 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -70,6 +74,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -275,7 +285,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb index 3a3f4bae412..52ad58881fc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb index 9558c78e7a4..6896d8d4ea9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb index 8b0583e4fef..626a5e509fe 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb index 2718038deb9..45c8bd07cd9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index f12f35a3fb9..b37131fafff 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +200,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 45322966bc5..17ed8749bf8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index cabaf4e8cad..abe18d148f9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index a285dd3e898..327dfd46785 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index cb66978d710..c1a31f16f62 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +203,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index ae6779e93d1..399c8bdd44c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -51,6 +55,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +225,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 8bc81970c33..cc5c575d064 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 1f825aad892..3fbd9b9d124 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 841876180d7..1d5afc07c6b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +195,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index 8fe3f0f3d6e..15a04a17c37 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 52f71511b6e..bcffca51c01 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index a94a6581d0f..faaf2b31576 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 8bedfe83840..4b62f47a316 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 6499e6c9384..571a34c7bf4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -56,6 +60,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +224,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 69fcebec615..05f483dc231 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index a4aabb4854d..90e58848ed1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -68,6 +72,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -280,7 +290,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index 62814e28236..a3db6ff30a4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -32,6 +36,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 0cfd2a0bafe..e3973cec448 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index dbd40a5ac05..87ec413718d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -82,6 +86,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -496,7 +506,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index f5bd2b3e5a9..265ee1ff62e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 2de84143b82..da3d106562c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 262374d278a..8297b2d2f87 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -64,6 +68,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +236,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 0fca26bc281..efd27371fc8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +199,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 7633a6473a1..76f11306d03 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -35,6 +39,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +189,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 96803b3cfca..9af9e5faa42 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index cc7b5f5f720..b451763c1f8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -43,6 +47,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +212,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index e22793a2ca1..ba25075f199 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 30082ec0207..182a75d3b39 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +261,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index e5a4dbbf7ff..f682dda3ef7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index d7c1b931b97..75f90f6ef0d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index aded7da65e0..56562092d66 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +273,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index bac38b69abc..75e13ee53da 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 12fec5a6901..98f72128730 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 7e89b7db239..30c3c0d1474 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb index 410967ec5b3..d2565f65e66 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -46,6 +50,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -236,7 +246,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb index c5af7812391..36d3cbb0451 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -50,6 +54,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -246,7 +256,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index ea5a393bead..bb73fcccac1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -59,6 +63,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +243,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb index 60698d77ece..b57ac3901de 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -142,6 +146,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -439,7 +449,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index fba2068c04d..639fff79857 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index d563bfe8e68..5ce083777a5 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb index a83b3e64916..7cbe2e78aad 100644 --- a/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby/spec/api/fake_api_spec.rb index f03b49d7833..60f4008028a 100644 --- a/samples/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb b/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb index eff08f1c93c..f4ce6f2178e 100644 --- a/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/api/pet_api_spec.rb b/samples/client/petstore/ruby/spec/api/pet_api_spec.rb index ca3fcccb207..3df9046501c 100644 --- a/samples/client/petstore/ruby/spec/api/pet_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/pet_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/api/store_api_spec.rb b/samples/client/petstore/ruby/spec/api/store_api_spec.rb index 2e82a54da14..ebe083f686a 100644 --- a/samples/client/petstore/ruby/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/store_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/api/user_api_spec.rb b/samples/client/petstore/ruby/spec/api/user_api_spec.rb index 1c0b025a3c3..7625e1cd19a 100644 --- a/samples/client/petstore/ruby/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/user_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/api_client_spec.rb b/samples/client/petstore/ruby/spec/api_client_spec.rb index 40811533188..33ede96b49b 100644 --- a/samples/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/configuration_spec.rb b/samples/client/petstore/ruby/spec/configuration_spec.rb index 0bea24033c6..be549c30bc4 100644 --- a/samples/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_any_type_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_any_type_spec.rb index 9fd0455c8d1..898812dcf4f 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_any_type_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_any_type_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_array_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_array_spec.rb index 5f3e0b37987..3ed1fcb4c10 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_array_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_array_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_boolean_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_boolean_spec.rb index c586dfe067a..0dca310cc05 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_boolean_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_boolean_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb index ee65b12fcc1..39675fc37a5 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_integer_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_integer_spec.rb index 2bc9d2238a2..ea77b8ef4d3 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_integer_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_integer_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_number_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_number_spec.rb index 9cb2c965c96..daaddc34478 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_number_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_number_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_object_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_object_spec.rb index c8cfee233f0..d993614b8b2 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_object_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_object_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_string_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_string_spec.rb index d658f506473..b11048f05c8 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_string_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_string_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/animal_spec.rb b/samples/client/petstore/ruby/spec/models/animal_spec.rb index 8b3e9adc537..886387d824c 100644 --- a/samples/client/petstore/ruby/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby/spec/models/animal_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/api_response_spec.rb b/samples/client/petstore/ruby/spec/models/api_response_spec.rb index 628f1c4d7c1..7bb27bc462f 100644 --- a/samples/client/petstore/ruby/spec/models/api_response_spec.rb +++ b/samples/client/petstore/ruby/spec/models/api_response_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb b/samples/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb index ea41c9a4b38..9fd8b1dcf17 100644 --- a/samples/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/array_of_number_only_spec.rb b/samples/client/petstore/ruby/spec/models/array_of_number_only_spec.rb index ba90932a797..7a7ce9edcff 100644 --- a/samples/client/petstore/ruby/spec/models/array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/array_test_spec.rb b/samples/client/petstore/ruby/spec/models/array_test_spec.rb index 6ff7397ad43..c9309afc0b8 100644 --- a/samples/client/petstore/ruby/spec/models/array_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/array_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby/spec/models/capitalization_spec.rb index 451c59af970..029ad6883af 100644 --- a/samples/client/petstore/ruby/spec/models/capitalization_spec.rb +++ b/samples/client/petstore/ruby/spec/models/capitalization_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/cat_all_of_spec.rb index 926ce8a2a37..2d12de79ff1 100644 --- a/samples/client/petstore/ruby/spec/models/cat_all_of_spec.rb +++ b/samples/client/petstore/ruby/spec/models/cat_all_of_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/cat_spec.rb b/samples/client/petstore/ruby/spec/models/cat_spec.rb index 3efb677ce64..2a2d12469ff 100644 --- a/samples/client/petstore/ruby/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby/spec/models/cat_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/category_spec.rb b/samples/client/petstore/ruby/spec/models/category_spec.rb index 82ecd78d966..76cd7315703 100644 --- a/samples/client/petstore/ruby/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby/spec/models/category_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/class_model_spec.rb b/samples/client/petstore/ruby/spec/models/class_model_spec.rb index 761e8933127..2d4b19e484c 100644 --- a/samples/client/petstore/ruby/spec/models/class_model_spec.rb +++ b/samples/client/petstore/ruby/spec/models/class_model_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/client_spec.rb b/samples/client/petstore/ruby/spec/models/client_spec.rb index 4bf1ce0622b..c7d3f30c794 100644 --- a/samples/client/petstore/ruby/spec/models/client_spec.rb +++ b/samples/client/petstore/ruby/spec/models/client_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/dog_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/dog_all_of_spec.rb index 5596927d423..c5a90f6018d 100644 --- a/samples/client/petstore/ruby/spec/models/dog_all_of_spec.rb +++ b/samples/client/petstore/ruby/spec/models/dog_all_of_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/dog_spec.rb b/samples/client/petstore/ruby/spec/models/dog_spec.rb index b82df3e9d72..2905492a554 100644 --- a/samples/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby/spec/models/dog_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb b/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb index ac75c92581d..469000b386c 100644 --- a/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/enum_class_spec.rb b/samples/client/petstore/ruby/spec/models/enum_class_spec.rb index 29fcd05aa75..97a4dde432d 100644 --- a/samples/client/petstore/ruby/spec/models/enum_class_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby/spec/models/enum_test_spec.rb index acd89c52dfe..a89e49cbe2c 100644 --- a/samples/client/petstore/ruby/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb b/samples/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb index 8a8d92658c9..bcc36bfe20a 100644 --- a/samples/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb +++ b/samples/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/file_spec.rb b/samples/client/petstore/ruby/spec/models/file_spec.rb index b9d1499766e..adbc136d4f1 100644 --- a/samples/client/petstore/ruby/spec/models/file_spec.rb +++ b/samples/client/petstore/ruby/spec/models/file_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/client/petstore/ruby/spec/models/format_test_spec.rb index 953fc14a6d1..cb82f23a35b 100644 --- a/samples/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/format_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/has_only_read_only_spec.rb b/samples/client/petstore/ruby/spec/models/has_only_read_only_spec.rb index 9efa03a22fe..be2313b3cc3 100644 --- a/samples/client/petstore/ruby/spec/models/has_only_read_only_spec.rb +++ b/samples/client/petstore/ruby/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/list_spec.rb b/samples/client/petstore/ruby/spec/models/list_spec.rb index db397aa108f..6e5c2ba353a 100644 --- a/samples/client/petstore/ruby/spec/models/list_spec.rb +++ b/samples/client/petstore/ruby/spec/models/list_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/map_test_spec.rb b/samples/client/petstore/ruby/spec/models/map_test_spec.rb index f7ff6788b09..1cb78a21bfc 100644 --- a/samples/client/petstore/ruby/spec/models/map_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/map_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb index 0e88f472524..0a6dbed9975 100644 --- a/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/model200_response_spec.rb b/samples/client/petstore/ruby/spec/models/model200_response_spec.rb index 133f6b94c14..47782594793 100644 --- a/samples/client/petstore/ruby/spec/models/model200_response_spec.rb +++ b/samples/client/petstore/ruby/spec/models/model200_response_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/model_return_spec.rb b/samples/client/petstore/ruby/spec/models/model_return_spec.rb index 57d400eb116..7b28f5bcf04 100644 --- a/samples/client/petstore/ruby/spec/models/model_return_spec.rb +++ b/samples/client/petstore/ruby/spec/models/model_return_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/name_spec.rb b/samples/client/petstore/ruby/spec/models/name_spec.rb index c882db4f221..aedde807f31 100644 --- a/samples/client/petstore/ruby/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby/spec/models/name_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/number_only_spec.rb b/samples/client/petstore/ruby/spec/models/number_only_spec.rb index 0963591fcc1..0a06e9682ee 100644 --- a/samples/client/petstore/ruby/spec/models/number_only_spec.rb +++ b/samples/client/petstore/ruby/spec/models/number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/order_spec.rb b/samples/client/petstore/ruby/spec/models/order_spec.rb index 3f1d973b275..fa3243537c0 100644 --- a/samples/client/petstore/ruby/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby/spec/models/order_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb index bb36f488959..80b636a0e54 100644 --- a/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb +++ b/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/outer_enum_spec.rb b/samples/client/petstore/ruby/spec/models/outer_enum_spec.rb index ea9762da93b..bd722d47f46 100644 --- a/samples/client/petstore/ruby/spec/models/outer_enum_spec.rb +++ b/samples/client/petstore/ruby/spec/models/outer_enum_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/pet_spec.rb b/samples/client/petstore/ruby/spec/models/pet_spec.rb index dc0a0898c9f..c2c85b82c27 100644 --- a/samples/client/petstore/ruby/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby/spec/models/pet_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb index 8d60e443313..4ab95118e9f 100644 --- a/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb +++ b/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb b/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb index b548f7f0951..8ca6493d9c8 100644 --- a/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb +++ b/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/tag_spec.rb b/samples/client/petstore/ruby/spec/models/tag_spec.rb index 3a745439040..f0eab291f5a 100644 --- a/samples/client/petstore/ruby/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby/spec/models/tag_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/type_holder_default_spec.rb b/samples/client/petstore/ruby/spec/models/type_holder_default_spec.rb index b7bf49dbca4..1ebe43f7724 100644 --- a/samples/client/petstore/ruby/spec/models/type_holder_default_spec.rb +++ b/samples/client/petstore/ruby/spec/models/type_holder_default_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/type_holder_example_spec.rb b/samples/client/petstore/ruby/spec/models/type_holder_example_spec.rb index ba58952fcc3..a54ea32230d 100644 --- a/samples/client/petstore/ruby/spec/models/type_holder_example_spec.rb +++ b/samples/client/petstore/ruby/spec/models/type_holder_example_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/user_spec.rb b/samples/client/petstore/ruby/spec/models/user_spec.rb index 2eb31e993a0..58cc20d1215 100644 --- a/samples/client/petstore/ruby/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby/spec/models/user_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/models/xml_item_spec.rb b/samples/client/petstore/ruby/spec/models/xml_item_spec.rb index 8f300f2f8ad..1054b841acb 100644 --- a/samples/client/petstore/ruby/spec/models/xml_item_spec.rb +++ b/samples/client/petstore/ruby/spec/models/xml_item_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/ruby/spec/spec_helper.rb b/samples/client/petstore/ruby/spec/spec_helper.rb index 64dcf6b8f47..b61ebfca154 100644 --- a/samples/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs index f1286a5d1c8..16c49d8d61d 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] pub code: Option, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs index dcd2dc38630..ed937ac261d 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs index 89cab91e62c..c64eae6d4ff 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -44,7 +44,7 @@ impl Order { } /// Order Status -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { #[serde(rename = "placed")] Placed, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs index ff8a32fee3a..36c9d22c069 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -44,7 +44,7 @@ impl Pet { } /// pet status in the store -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { #[serde(rename = "available")] Available, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs index f6bcb5c78d6..e0ae6e9efcc 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs index cf863af7b58..360df3b9ec3 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/hyper/rust-test/src/models/type_testing.rs b/samples/client/petstore/rust/hyper/rust-test/src/models/type_testing.rs index 57188e8ee7e..530d1d1365d 100644 --- a/samples/client/petstore/rust/hyper/rust-test/src/models/type_testing.rs +++ b/samples/client/petstore/rust/hyper/rust-test/src/models/type_testing.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "integer", skip_serializing_if = "Option::is_none")] pub integer: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs index f1286a5d1c8..16c49d8d61d 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] pub code: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs index dcd2dc38630..ed937ac261d 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs index 89cab91e62c..c64eae6d4ff 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -44,7 +44,7 @@ impl Order { } /// Order Status -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { #[serde(rename = "placed")] Placed, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs index ff8a32fee3a..36c9d22c069 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -44,7 +44,7 @@ impl Pet { } /// pet status in the store -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { #[serde(rename = "available")] Available, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs index f6bcb5c78d6..e0ae6e9efcc 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs index cf863af7b58..360df3b9ec3 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/reqwest/rust-test/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/rust-test/src/models/type_testing.rs index 57188e8ee7e..530d1d1365d 100644 --- a/samples/client/petstore/rust/reqwest/rust-test/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/rust-test/src/models/type_testing.rs @@ -12,7 +12,7 @@ -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "integer", skip_serializing_if = "Option::is_none")] pub integer: Option, diff --git a/samples/client/petstore/scalaz/.openapi-generator/VERSION b/samples/client/petstore/scalaz/.openapi-generator/VERSION index 096bf47efe3..e4955748d3e 100644 --- a/samples/client/petstore/scalaz/.openapi-generator/VERSION +++ b/samples/client/petstore/scalaz/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scalaz/project/build.properties b/samples/client/petstore/scalaz/project/build.properties new file mode 100644 index 00000000000..cf19fd026fd --- /dev/null +++ b/samples/client/petstore/scalaz/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.13.15 \ No newline at end of file diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/ApiResponse.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/ApiResponse.scala index 62497849b41..457b5fd3fd9 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/ApiResponse.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/ApiResponse.scala @@ -7,6 +7,8 @@ import argonaut.DecodeJson._ import org.http4s.{EntityDecoder, EntityEncoder} import org.http4s.argonaut._ import org.joda.time.DateTime + + import ApiResponse._ case class ApiResponse ( diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Category.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Category.scala index cbc45f6e3f1..a3323b05c59 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Category.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Category.scala @@ -7,6 +7,8 @@ import argonaut.DecodeJson._ import org.http4s.{EntityDecoder, EntityEncoder} import org.http4s.argonaut._ import org.joda.time.DateTime + + import Category._ case class Category ( diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Order.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Order.scala index d228f817bd4..67e3cd4318a 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Order.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Order.scala @@ -7,6 +7,9 @@ import argonaut.DecodeJson._ import org.http4s.{EntityDecoder, EntityEncoder} import org.http4s.argonaut._ import org.joda.time.DateTime + +import org.joda.time.DateTime + import Order._ case class Order ( diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Pet.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Pet.scala index 9b75836b88a..933df79c621 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Pet.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Pet.scala @@ -7,6 +7,8 @@ import argonaut.DecodeJson._ import org.http4s.{EntityDecoder, EntityEncoder} import org.http4s.argonaut._ import org.joda.time.DateTime + + import Pet._ case class Pet ( diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala index bafe205709c..79636d5560a 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -21,13 +21,17 @@ import scalaz.concurrent.Task import HelperCodecs._ +import org.openapitools.client.api.ApiResponse +import java.io.File +import org.openapitools.client.api.Pet + object PetApi { val client = PooledHttp1Client() def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") - def addPet(host: String, pet: Pet): Task[Unit] = { + def addPet(host: String, body: Pet): Task[Unit] = { val path = "/pet" val httpMethod = Method.POST @@ -40,7 +44,7 @@ object PetApi { for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(pet) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp @@ -65,7 +69,7 @@ object PetApi { } yield resp } - def findPetsByStatus(host: String, status: List[String])(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByStatus(host: String, status: List[String] = List.empty[String] )(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByStatus" @@ -86,7 +90,7 @@ object PetApi { } yield resp } - def findPetsByTags(host: String, tags: List[String])(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByTags(host: String, tags: List[String] = List.empty[String] )(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByTags" @@ -128,7 +132,7 @@ object PetApi { } yield resp } - def updatePet(host: String, pet: Pet): Task[Unit] = { + def updatePet(host: String, body: Pet): Task[Unit] = { val path = "/pet" val httpMethod = Method.PUT @@ -141,7 +145,7 @@ object PetApi { for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(pet) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp @@ -194,7 +198,7 @@ class HttpServicePetApi(service: HttpService) { def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") - def addPet(pet: Pet): Task[Unit] = { + def addPet(body: Pet): Task[Unit] = { val path = "/pet" val httpMethod = Method.POST @@ -207,7 +211,7 @@ class HttpServicePetApi(service: HttpService) { for { uri <- Task.fromDisjunction(Uri.fromString(path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(pet) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp @@ -232,7 +236,7 @@ class HttpServicePetApi(service: HttpService) { } yield resp } - def findPetsByStatus(status: List[String])(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByStatus(status: List[String] = List.empty[String] )(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByStatus" @@ -253,7 +257,7 @@ class HttpServicePetApi(service: HttpService) { } yield resp } - def findPetsByTags(tags: List[String])(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByTags(tags: List[String] = List.empty[String] )(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByTags" @@ -295,7 +299,7 @@ class HttpServicePetApi(service: HttpService) { } yield resp } - def updatePet(pet: Pet): Task[Unit] = { + def updatePet(body: Pet): Task[Unit] = { val path = "/pet" val httpMethod = Method.PUT @@ -308,7 +312,7 @@ class HttpServicePetApi(service: HttpService) { for { uri <- Task.fromDisjunction(Uri.fromString(path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(pet) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/StoreApi.scala index 30548fac93d..ccb0607174a 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -21,6 +21,8 @@ import scalaz.concurrent.Task import HelperCodecs._ +import org.openapitools.client.api.Order + object StoreApi { val client = PooledHttp1Client() @@ -88,7 +90,7 @@ object StoreApi { } yield resp } - def placeOrder(host: String, order: Order): Task[Order] = { + def placeOrder(host: String, body: Order): Task[Order] = { implicit val returnTypeDecoder: EntityDecoder[Order] = jsonOf[Order] val path = "/store/order" @@ -103,7 +105,7 @@ object StoreApi { for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(order) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.expect[Order](req) } yield resp @@ -177,7 +179,7 @@ class HttpServiceStoreApi(service: HttpService) { } yield resp } - def placeOrder(order: Order): Task[Order] = { + def placeOrder(body: Order): Task[Order] = { implicit val returnTypeDecoder: EntityDecoder[Order] = jsonOf[Order] val path = "/store/order" @@ -192,7 +194,7 @@ class HttpServiceStoreApi(service: HttpService) { for { uri <- Task.fromDisjunction(Uri.fromString(path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(order) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.expect[Order](req) } yield resp diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Tag.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Tag.scala index 96f7807e0a6..2c1e248ba2b 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Tag.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/Tag.scala @@ -7,6 +7,8 @@ import argonaut.DecodeJson._ import org.http4s.{EntityDecoder, EntityEncoder} import org.http4s.argonaut._ import org.joda.time.DateTime + + import Tag._ case class Tag ( diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/User.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/User.scala index 99a6ca61b51..bf1d2054079 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/User.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/User.scala @@ -7,6 +7,8 @@ import argonaut.DecodeJson._ import org.http4s.{EntityDecoder, EntityEncoder} import org.http4s.argonaut._ import org.joda.time.DateTime + + import User._ case class User ( diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/UserApi.scala index 4699158f917..ff45c31941f 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -21,13 +21,15 @@ import scalaz.concurrent.Task import HelperCodecs._ +import org.openapitools.client.api.User + object UserApi { val client = PooledHttp1Client() def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") - def createUser(host: String, user: User): Task[Unit] = { + def createUser(host: String, body: User): Task[Unit] = { val path = "/user" val httpMethod = Method.POST @@ -40,13 +42,13 @@ object UserApi { for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp } - def createUsersWithArrayInput(host: String, user: List[User]): Task[Unit] = { + def createUsersWithArrayInput(host: String, body: List[User]): Task[Unit] = { val path = "/user/createWithArray" val httpMethod = Method.POST @@ -59,13 +61,13 @@ object UserApi { for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp } - def createUsersWithListInput(host: String, user: List[User]): Task[Unit] = { + def createUsersWithListInput(host: String, body: List[User]): Task[Unit] = { val path = "/user/createWithList" val httpMethod = Method.POST @@ -78,7 +80,7 @@ object UserApi { for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp @@ -164,7 +166,7 @@ object UserApi { } yield resp } - def updateUser(host: String, username: String, user: User): Task[Unit] = { + def updateUser(host: String, username: String, body: User): Task[Unit] = { val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) val httpMethod = Method.PUT @@ -177,7 +179,7 @@ object UserApi { for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp @@ -190,7 +192,7 @@ class HttpServiceUserApi(service: HttpService) { def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") - def createUser(user: User): Task[Unit] = { + def createUser(body: User): Task[Unit] = { val path = "/user" val httpMethod = Method.POST @@ -203,13 +205,13 @@ class HttpServiceUserApi(service: HttpService) { for { uri <- Task.fromDisjunction(Uri.fromString(path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp } - def createUsersWithArrayInput(user: List[User]): Task[Unit] = { + def createUsersWithArrayInput(body: List[User]): Task[Unit] = { val path = "/user/createWithArray" val httpMethod = Method.POST @@ -222,13 +224,13 @@ class HttpServiceUserApi(service: HttpService) { for { uri <- Task.fromDisjunction(Uri.fromString(path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp } - def createUsersWithListInput(user: List[User]): Task[Unit] = { + def createUsersWithListInput(body: List[User]): Task[Unit] = { val path = "/user/createWithList" val httpMethod = Method.POST @@ -241,7 +243,7 @@ class HttpServiceUserApi(service: HttpService) { for { uri <- Task.fromDisjunction(Uri.fromString(path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp @@ -327,7 +329,7 @@ class HttpServiceUserApi(service: HttpService) { } yield resp } - def updateUser(username: String, user: User): Task[Unit] = { + def updateUser(username: String, body: User): Task[Unit] = { val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) val httpMethod = Method.PUT @@ -340,7 +342,7 @@ class HttpServiceUserApi(service: HttpService) { for { uri <- Task.fromDisjunction(Uri.fromString(path)) uriWithParams = uri.copy(query = queryParams) - req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(user) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) resp <- client.fetch[Unit](req)(_ => Task.now(())) } yield resp diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 577c619e939..548d7a0eb06 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index a82212b2fc6..964aeead0c8 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index d63c42087ae..4957b81ea48 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 14717052607..25d3867afdd 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 3fa5a45bea2..7aee13a414d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index fbbea575bcd..b7ec3639ea4 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index e907cb67af3..b2ab2fff58d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -86,11 +90,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -116,11 +122,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -144,11 +152,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -210,7 +220,8 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index c27e348531c..51d9a56ccb0 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,11 +78,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -99,11 +105,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index c185766cda9..35583ab49b1 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -93,11 +97,13 @@ public interface UserApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh index 180aec08bb5..410c6814dbb 100755 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.0" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.0" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=12.4" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=12.4" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh index 5de11477461..dce4932ae62 100755 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=13.0" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/rxswift/SwaggerClientTests/run_xcodebuild.sh index 5de11477461..dce4932ae62 100755 --- a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift4/rxswift/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=13.0" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 9c9ee52b1e5..df0ef7ccd01 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -26,6 +26,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { @@ -64,6 +65,7 @@ export class PetService { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -80,6 +82,7 @@ export class PetService { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -97,6 +100,7 @@ export class PetService { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -113,6 +117,7 @@ export class PetService { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -129,6 +134,7 @@ export class PetService { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -145,6 +151,7 @@ export class PetService { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -161,6 +168,7 @@ export class PetService { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -179,6 +187,7 @@ export class PetService { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -198,7 +207,6 @@ export class PetService { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -252,7 +260,6 @@ export class PetService { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -298,7 +305,6 @@ export class PetService { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -349,7 +355,6 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -400,7 +405,6 @@ export class PetService { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -441,7 +445,6 @@ export class PetService { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -496,7 +499,6 @@ export class PetService { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -567,7 +569,6 @@ export class PetService { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 2c745639402..9a84a67805e 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { @@ -50,6 +51,7 @@ export class StoreService { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class StoreService { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -81,6 +84,7 @@ export class StoreService { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -97,6 +101,7 @@ export class StoreService { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -115,7 +120,6 @@ export class StoreService { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -149,7 +153,6 @@ export class StoreService { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -187,7 +190,6 @@ export class StoreService { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -223,7 +225,6 @@ export class StoreService { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 9ce463aa829..49f4c7f4732 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { @@ -50,6 +51,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -82,6 +85,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -98,6 +102,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -114,6 +119,7 @@ export class UserService { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -130,6 +136,7 @@ export class UserService { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -147,6 +154,7 @@ export class UserService { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -162,6 +170,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -181,7 +190,6 @@ export class UserService { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -224,7 +232,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -267,7 +274,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -311,7 +317,6 @@ export class UserService { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -345,7 +350,6 @@ export class UserService { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -382,7 +386,6 @@ export class UserService { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -429,7 +432,6 @@ export class UserService { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -462,7 +464,6 @@ export class UserService { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 9c9ee52b1e5..df0ef7ccd01 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -26,6 +26,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { @@ -64,6 +65,7 @@ export class PetService { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -80,6 +82,7 @@ export class PetService { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -97,6 +100,7 @@ export class PetService { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -113,6 +117,7 @@ export class PetService { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -129,6 +134,7 @@ export class PetService { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -145,6 +151,7 @@ export class PetService { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -161,6 +168,7 @@ export class PetService { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -179,6 +187,7 @@ export class PetService { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -198,7 +207,6 @@ export class PetService { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -252,7 +260,6 @@ export class PetService { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -298,7 +305,6 @@ export class PetService { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -349,7 +355,6 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -400,7 +405,6 @@ export class PetService { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -441,7 +445,6 @@ export class PetService { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -496,7 +499,6 @@ export class PetService { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -567,7 +569,6 @@ export class PetService { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 2c745639402..9a84a67805e 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { @@ -50,6 +51,7 @@ export class StoreService { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class StoreService { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -81,6 +84,7 @@ export class StoreService { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -97,6 +101,7 @@ export class StoreService { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -115,7 +120,6 @@ export class StoreService { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -149,7 +153,6 @@ export class StoreService { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -187,7 +190,6 @@ export class StoreService { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -223,7 +225,6 @@ export class StoreService { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 9ce463aa829..49f4c7f4732 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { @@ -50,6 +51,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -82,6 +85,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -98,6 +102,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -114,6 +119,7 @@ export class UserService { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -130,6 +136,7 @@ export class UserService { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -147,6 +154,7 @@ export class UserService { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -162,6 +170,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -181,7 +190,6 @@ export class UserService { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -224,7 +232,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -267,7 +274,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -311,7 +317,6 @@ export class UserService { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -345,7 +350,6 @@ export class UserService { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -382,7 +386,6 @@ export class UserService { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -429,7 +432,6 @@ export class UserService { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -462,7 +464,6 @@ export class UserService { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index c75e5e46ddd..4937a32e7bb 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -24,7 +24,10 @@ import { Pet } from '../model/pet'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { PetServiceInterface } from './pet.serviceInterface'; +import { + PetServiceInterface +} from './pet.serviceInterface'; + @Injectable() @@ -65,6 +68,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -81,6 +85,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -98,6 +103,7 @@ export class PetService implements PetServiceInterface { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -114,6 +120,7 @@ export class PetService implements PetServiceInterface { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -130,6 +137,7 @@ export class PetService implements PetServiceInterface { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -146,6 +154,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -162,6 +171,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -180,6 +190,7 @@ export class PetService implements PetServiceInterface { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -199,7 +210,6 @@ export class PetService implements PetServiceInterface { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -253,7 +263,6 @@ export class PetService implements PetServiceInterface { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -299,7 +308,6 @@ export class PetService implements PetServiceInterface { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -350,7 +358,6 @@ export class PetService implements PetServiceInterface { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -401,7 +408,6 @@ export class PetService implements PetServiceInterface { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -442,7 +448,6 @@ export class PetService implements PetServiceInterface { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -497,7 +502,6 @@ export class PetService implements PetServiceInterface { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -568,7 +572,6 @@ export class PetService implements PetServiceInterface { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts index effb9d16d02..281ca0c65c3 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts @@ -20,70 +20,71 @@ import { Pet } from '../model/pet'; import { Configuration } from '../configuration'; + export interface PetServiceInterface { defaultHeaders: Headers; configuration: Configuration; [others: string]: any; /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - */ + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + */ addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}>; /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey - */ + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + */ deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable<{}>; /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - */ + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: any): Observable>; /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - */ + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + */ findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable>; /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - */ + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + */ getPetById(petId: number, extraHttpRequestParams?: any): Observable; /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - */ + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + */ updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}>; /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + */ updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}>; /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 147e0c8dfd5..744e2a3e9b5 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -23,7 +23,10 @@ import { Order } from '../model/order'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { StoreServiceInterface } from './store.serviceInterface'; +import { + StoreServiceInterface +} from './store.serviceInterface'; + @Injectable() @@ -51,6 +54,7 @@ export class StoreService implements StoreServiceInterface { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -67,6 +71,7 @@ export class StoreService implements StoreServiceInterface { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -82,6 +87,7 @@ export class StoreService implements StoreServiceInterface { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -98,6 +104,7 @@ export class StoreService implements StoreServiceInterface { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -116,7 +123,6 @@ export class StoreService implements StoreServiceInterface { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -150,7 +156,6 @@ export class StoreService implements StoreServiceInterface { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -188,7 +193,6 @@ export class StoreService implements StoreServiceInterface { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -224,7 +228,6 @@ export class StoreService implements StoreServiceInterface { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts index f03e6a2df3a..39296ccb7e1 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts @@ -19,36 +19,37 @@ import { Order } from '../model/order'; import { Configuration } from '../configuration'; + export interface StoreServiceInterface { defaultHeaders: Headers; configuration: Configuration; [others: string]: any; /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - */ + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + */ deleteOrder(orderId: string, extraHttpRequestParams?: any): Observable<{}>; /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - */ + * Returns pet inventories by status + * Returns a map of status codes to quantities + */ getInventory(extraHttpRequestParams?: any): Observable<{ [key: string]: number; }>; /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - */ + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + */ getOrderById(orderId: number, extraHttpRequestParams?: any): Observable; /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - */ + * Place an order for a pet + * + * @param body order placed for purchasing the pet + */ placeOrder(body: Order, extraHttpRequestParams?: any): Observable; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index d9acd360ef3..1b4542f3e8b 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -23,7 +23,10 @@ import { User } from '../model/user'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { UserServiceInterface } from './user.serviceInterface'; +import { + UserServiceInterface +} from './user.serviceInterface'; + @Injectable() @@ -51,6 +54,7 @@ export class UserService implements UserServiceInterface { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -67,6 +71,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -83,6 +88,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -99,6 +105,7 @@ export class UserService implements UserServiceInterface { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -115,6 +122,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -131,6 +139,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -148,6 +157,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -163,6 +173,7 @@ export class UserService implements UserServiceInterface { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -182,7 +193,6 @@ export class UserService implements UserServiceInterface { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -225,7 +235,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -268,7 +277,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -312,7 +320,6 @@ export class UserService implements UserServiceInterface { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -346,7 +353,6 @@ export class UserService implements UserServiceInterface { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -383,7 +389,6 @@ export class UserService implements UserServiceInterface { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -430,7 +435,6 @@ export class UserService implements UserServiceInterface { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -463,7 +467,6 @@ export class UserService implements UserServiceInterface { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts index a067c872bd6..ba857806fba 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts @@ -19,66 +19,67 @@ import { User } from '../model/user'; import { Configuration } from '../configuration'; + export interface UserServiceInterface { defaultHeaders: Headers; configuration: Configuration; [others: string]: any; /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - */ + * Create user + * This can only be done by the logged in user. + * @param body Created user object + */ createUser(body: User, extraHttpRequestParams?: any): Observable<{}>; /** - * Creates list of users with given input array - * - * @param body List of user object - */ + * Creates list of users with given input array + * + * @param body List of user object + */ createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; /** - * Creates list of users with given input array - * - * @param body List of user object - */ + * Creates list of users with given input array + * + * @param body List of user object + */ createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - */ + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + */ deleteUser(username: string, extraHttpRequestParams?: any): Observable<{}>; /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - */ + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + */ getUserByName(username: string, extraHttpRequestParams?: any): Observable; /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - */ + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + */ loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable; /** - * Logs out current logged in user session - * - */ + * Logs out current logged in user session + * + */ logoutUser(extraHttpRequestParams?: any): Observable<{}>; /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - */ + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + */ updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}>; } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 1d5843d4042..7fe1b177c46 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index eb7539d0d52..fc37529edc6 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 0f0a22e8234..b1cb03cc470 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 9c9ee52b1e5..df0ef7ccd01 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -26,6 +26,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { @@ -64,6 +65,7 @@ export class PetService { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -80,6 +82,7 @@ export class PetService { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -97,6 +100,7 @@ export class PetService { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -113,6 +117,7 @@ export class PetService { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -129,6 +134,7 @@ export class PetService { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -145,6 +151,7 @@ export class PetService { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -161,6 +168,7 @@ export class PetService { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -179,6 +187,7 @@ export class PetService { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -198,7 +207,6 @@ export class PetService { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -252,7 +260,6 @@ export class PetService { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -298,7 +305,6 @@ export class PetService { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -349,7 +355,6 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -400,7 +405,6 @@ export class PetService { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -441,7 +445,6 @@ export class PetService { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -496,7 +499,6 @@ export class PetService { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -567,7 +569,6 @@ export class PetService { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 2c745639402..9a84a67805e 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { @@ -50,6 +51,7 @@ export class StoreService { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class StoreService { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -81,6 +84,7 @@ export class StoreService { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -97,6 +101,7 @@ export class StoreService { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -115,7 +120,6 @@ export class StoreService { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -149,7 +153,6 @@ export class StoreService { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -187,7 +190,6 @@ export class StoreService { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -223,7 +225,6 @@ export class StoreService { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index 9ce463aa829..49f4c7f4732 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { @@ -50,6 +51,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -82,6 +85,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -98,6 +102,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -114,6 +119,7 @@ export class UserService { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -130,6 +136,7 @@ export class UserService { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -147,6 +154,7 @@ export class UserService { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -162,6 +170,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -181,7 +190,6 @@ export class UserService { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -224,7 +232,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -267,7 +274,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -311,7 +317,6 @@ export class UserService { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -345,7 +350,6 @@ export class UserService { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -382,7 +386,6 @@ export class UserService { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -429,7 +432,6 @@ export class UserService { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -462,7 +464,6 @@ export class UserService { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-fetch/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.gitignore similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/.gitignore rename to samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.gitignore diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION new file mode 100644 index 00000000000..e4955748d3e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/README.md b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/README.md new file mode 100644 index 00000000000..ab47bc7e406 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/README.md @@ -0,0 +1,180 @@ +## @openapitools/typescript-angular-petstore@1.0.0 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @openapitools/typescript-angular-petstore@1.0.0 --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link @openapitools/typescript-angular-petstore +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from '@openapitools/typescript-angular-petstore'; +import { HttpClientModule } from '@angular/common/http'; + + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '@openapitools/typescript-angular-petstore'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api.module.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api.module.ts new file mode 100644 index 00000000000..8487243a83b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api.module.ts @@ -0,0 +1,37 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [ + PetService, + StoreService, + UserService ] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/api.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/api.ts new file mode 100644 index 00000000000..8e44b64083d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts new file mode 100644 index 00000000000..4156b6a005e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -0,0 +1,553 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/apiResponse'; +import { Pet } from '../model/pet'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +export interface AddPetRequestParams { + body: Pet; +} + +export interface DeletePetRequestParams { + petId: number; + apiKey?: string; +} + +export interface FindPetsByStatusRequestParams { + status: Array<'available' | 'pending' | 'sold'>; +} + +export interface FindPetsByTagsRequestParams { + tags: Array; +} + +export interface GetPetByIdRequestParams { + petId: number; +} + +export interface UpdatePetRequestParams { + body: Pet; +} + +export interface UpdatePetWithFormRequestParams { + petId: number; + name?: string; + status?: string; +} + +export interface UploadFileRequestParams { + petId: number; + additionalMetadata?: string; + file?: Blob; +} + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + + /** + * Add a new pet to the store + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(requestParameters: AddPetRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public addPet(requestParameters: AddPetRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public addPet(requestParameters: AddPetRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public addPet(requestParameters: AddPetRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public deletePet(requestParameters: DeletePetRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + const apiKey = requestParameters.apiKey; + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers = headers.set('api_key', String(apiKey)); + } + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'body', reportProgress?: boolean): Observable>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'response', reportProgress?: boolean): Observable>>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'events', reportProgress?: boolean): Observable>>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const status = requestParameters.status; + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'body', reportProgress?: boolean): Observable>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'response', reportProgress?: boolean): Observable>>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'events', reportProgress?: boolean): Observable>>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const tags = requestParameters.tags; + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public getPetById(requestParameters: GetPetByIdRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { + headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public updatePet(requestParameters: UpdatePetRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const name = requestParameters.name; + const status = requestParameters.status; + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + formParams = formParams.append('name', name) as any || formParams; + } + if (status !== undefined) { + formParams = formParams.append('status', status) as any || formParams; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public uploadFile(requestParameters: UploadFileRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + const additionalMetadata = requestParameters.additionalMetadata; + const file = requestParameters.file; + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + formParams = formParams.append('additionalMetadata', additionalMetadata) as any || formParams; + } + if (file !== undefined) { + formParams = formParams.append('file', file) as any || formParams; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts new file mode 100644 index 00000000000..f5ce3496728 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -0,0 +1,225 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/order'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +export interface DeleteOrderRequestParams { + orderId: string; +} + +export interface GetOrderByIdRequestParams { + orderId: number; +} + +export interface PlaceOrderRequestParams { + body: Order; +} + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const orderId = requestParameters.orderId; + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { + headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const orderId = requestParameters.orderId; + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts new file mode 100644 index 00000000000..00056c76771 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -0,0 +1,425 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/user'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +export interface CreateUserRequestParams { + body: User; +} + +export interface CreateUsersWithArrayInputRequestParams { + body: Array; +} + +export interface CreateUsersWithListInputRequestParams { + body: Array; +} + +export interface DeleteUserRequestParams { + username: string; +} + +export interface GetUserByNameRequestParams { + username: string; +} + +export interface LoginUserRequestParams { + username: string; + password: string; +} + +export interface UpdateUserRequestParams { + username: string; + body: User; +} + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + + /** + * Create user + * This can only be done by the logged in user. + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(requestParameters: CreateUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public createUser(requestParameters: CreateUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public createUser(requestParameters: CreateUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public createUser(requestParameters: CreateUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteUser(requestParameters: DeleteUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public loginUser(requestParameters: LoginUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + const password = requestParameters.password; + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + queryParameters = queryParameters.set('username', username); + } + if (password !== undefined && password !== null) { + queryParameters = queryParameters.set('password', password); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param requestParameters + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public updateUser(requestParameters: UpdateUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts new file mode 100644 index 00000000000..c038bbc9478 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts @@ -0,0 +1,84 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/encoder.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/encoder.ts new file mode 100644 index 00000000000..cbefb4a6dd9 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/encoder.ts @@ -0,0 +1,21 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/git_push.sh b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/git_push.sh new file mode 100644 index 00000000000..ced3be2b0c7 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/index.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/index.ts new file mode 100644 index 00000000000..c312b70fa3e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/apiResponse.ts new file mode 100644 index 00000000000..682ba478921 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/category.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/category.ts new file mode 100644 index 00000000000..b988b6827a0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/models.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/models.ts new file mode 100644 index 00000000000..8607c5dabd0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/order.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/order.ts new file mode 100644 index 00000000000..c8d8a5e55c0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: Date; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/pet.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/pet.ts new file mode 100644 index 00000000000..e0404395f91 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/tag.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/tag.ts new file mode 100644 index 00000000000..b6ff210e8df --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/user.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/user.ts new file mode 100644 index 00000000000..fce51005300 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/ng-package.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/ng-package.json new file mode 100644 index 00000000000..3b17900dc9c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/package.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/package.json new file mode 100644 index 00000000000..4704f50abdc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/package.json @@ -0,0 +1,38 @@ +{ + "name": "@openapitools/typescript-angular-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-angular-petstore", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^8.0.0", + "@angular/common": "^8.0.0", + "@angular/compiler": "^8.0.0", + "core-js": "^2.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.5.0" + }, + "devDependencies": { + "@angular/common": "^8.0.0", + "@angular/compiler": "^8.0.0", + "@angular/compiler-cli": "^8.0.0", + "@angular/core": "^8.0.0", + "@angular/platform-browser": "^8.0.0", + "ng-packagr": "^5.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.5.0", + "tsickle": "^0.35.0", + "typescript": ">=3.4.0 <3.6.0", + "zone.js": "^0.9.1" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/tsconfig.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/tsconfig.json new file mode 100644 index 00000000000..c01ebe255d4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/variables.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/variables.ts new file mode 100644 index 00000000000..6fe58549f39 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/index.ts b/samples/client/petstore/typescript-fetch/builds/default/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/default/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts similarity index 92% rename from samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/default/models/Order.ts index cae61335b78..aae84ac329d 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts @@ -70,7 +70,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], - 'shipDate': !exists(json, 'shipDate') ? undefined : new Date(json['shipDate']), + 'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])), 'status': !exists(json, 'status') ? undefined : json['status'], 'complete': !exists(json, 'complete') ? undefined : json['complete'], }; @@ -88,7 +88,7 @@ export function OrderToJSON(value?: Order | null): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts similarity index 92% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts index ecd7e174a20..2a0ca231c74 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts @@ -82,7 +82,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], 'photoUrls': json['photoUrls'], - 'tags': !exists(json, 'tags') ? undefined : (json['tags'] as Array).map(TagFromJSON), + 'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array).map(TagFromJSON)), 'status': !exists(json, 'status') ? undefined : json['status'], }; } @@ -100,7 +100,7 @@ export function PetToJSON(value?: Pet | null): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags === undefined ? undefined : ((value.tags as Array).map(TagToJSON)), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/default/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/default/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json deleted file mode 100644 index 4567ec19899..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "outDir": "dist", - "lib": [ - "es6", - "dom" - ], - "typeRoots": [ - "node_modules/@types" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts index cae61335b78..aae84ac329d 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts @@ -70,7 +70,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], - 'shipDate': !exists(json, 'shipDate') ? undefined : new Date(json['shipDate']), + 'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])), 'status': !exists(json, 'status') ? undefined : json['status'], 'complete': !exists(json, 'complete') ? undefined : json['complete'], }; @@ -88,7 +88,7 @@ export function OrderToJSON(value?: Order | null): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts index ecd7e174a20..2a0ca231c74 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts @@ -82,7 +82,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], 'photoUrls': json['photoUrls'], - 'tags': !exists(json, 'tags') ? undefined : (json['tags'] as Array).map(TagFromJSON), + 'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array).map(TagFromJSON)), 'status': !exists(json, 'status') ? undefined : json['status'], }; } @@ -100,7 +100,7 @@ export function PetToJSON(value?: Pet | null): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags === undefined ? undefined : ((value.tags as Array).map(TagToJSON)), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.gitignore b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.gitignore deleted file mode 100644 index 149b5765472..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -wwwroot/*.js -node_modules -typings -dist diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts similarity index 92% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts index cae61335b78..aae84ac329d 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts @@ -70,7 +70,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], - 'shipDate': !exists(json, 'shipDate') ? undefined : new Date(json['shipDate']), + 'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])), 'status': !exists(json, 'status') ? undefined : json['status'], 'complete': !exists(json, 'complete') ? undefined : json['complete'], }; @@ -88,7 +88,7 @@ export function OrderToJSON(value?: Order | null): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts similarity index 92% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts index ecd7e174a20..2a0ca231c74 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts @@ -82,7 +82,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], 'photoUrls': json['photoUrls'], - 'tags': !exists(json, 'tags') ? undefined : (json['tags'] as Array).map(TagFromJSON), + 'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array).map(TagFromJSON)), 'status': !exists(json, 'status') ? undefined : json['status'], }; } @@ -100,7 +100,7 @@ export function PetToJSON(value?: Pet | null): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags === undefined ? undefined : ((value.tags as Array).map(TagToJSON)), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json deleted file mode 100644 index 4567ec19899..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "outDir": "dist", - "lib": [ - "es6", - "dom" - ], - "typeRoots": [ - "node_modules/@types" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts index cae61335b78..aae84ac329d 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts @@ -70,7 +70,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], - 'shipDate': !exists(json, 'shipDate') ? undefined : new Date(json['shipDate']), + 'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])), 'status': !exists(json, 'status') ? undefined : json['status'], 'complete': !exists(json, 'complete') ? undefined : json['complete'], }; @@ -88,7 +88,7 @@ export function OrderToJSON(value?: Order | null): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts index ecd7e174a20..2a0ca231c74 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts @@ -82,7 +82,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], 'photoUrls': json['photoUrls'], - 'tags': !exists(json, 'tags') ? undefined : (json['tags'] as Array).map(TagFromJSON), + 'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array).map(TagFromJSON)), 'status': !exists(json, 'status') ? undefined : json['status'], }; } @@ -100,7 +100,7 @@ export function PetToJSON(value?: Pet | null): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags === undefined ? undefined : ((value.tags as Array).map(TagToJSON)), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts index cae61335b78..aae84ac329d 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts @@ -70,7 +70,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], - 'shipDate': !exists(json, 'shipDate') ? undefined : new Date(json['shipDate']), + 'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])), 'status': !exists(json, 'status') ? undefined : json['status'], 'complete': !exists(json, 'complete') ? undefined : json['complete'], }; @@ -88,7 +88,7 @@ export function OrderToJSON(value?: Order | null): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts index ecd7e174a20..2a0ca231c74 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts @@ -82,7 +82,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], 'photoUrls': json['photoUrls'], - 'tags': !exists(json, 'tags') ? undefined : (json['tags'] as Array).map(TagFromJSON), + 'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array).map(TagFromJSON)), 'status': !exists(json, 'status') ? undefined : json['status'], }; } @@ -100,7 +100,7 @@ export function PetToJSON(value?: Pet | null): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags === undefined ? undefined : ((value.tags as Array).map(TagToJSON)), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.gitignore b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.gitignore deleted file mode 100644 index 149b5765472..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -wwwroot/*.js -node_modules -typings -dist diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts similarity index 92% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts index cae61335b78..aae84ac329d 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts @@ -70,7 +70,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], - 'shipDate': !exists(json, 'shipDate') ? undefined : new Date(json['shipDate']), + 'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])), 'status': !exists(json, 'status') ? undefined : json['status'], 'complete': !exists(json, 'complete') ? undefined : json['complete'], }; @@ -88,7 +88,7 @@ export function OrderToJSON(value?: Order | null): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts similarity index 92% rename from samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts index ecd7e174a20..2a0ca231c74 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts @@ -82,7 +82,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], 'photoUrls': json['photoUrls'], - 'tags': !exists(json, 'tags') ? undefined : (json['tags'] as Array).map(TagFromJSON), + 'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array).map(TagFromJSON)), 'status': !exists(json, 'status') ? undefined : json['status'], }; } @@ -100,7 +100,7 @@ export function PetToJSON(value?: Pet | null): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags === undefined ? undefined : ((value.tags as Array).map(TagToJSON)), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json deleted file mode 100644 index 4567ec19899..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "outDir": "dist", - "lib": [ - "es6", - "dom" - ], - "typeRoots": [ - "node_modules/@types" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts index cae61335b78..aae84ac329d 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts @@ -70,7 +70,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], - 'shipDate': !exists(json, 'shipDate') ? undefined : new Date(json['shipDate']), + 'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])), 'status': !exists(json, 'status') ? undefined : json['status'], 'complete': !exists(json, 'complete') ? undefined : json['complete'], }; @@ -88,7 +88,7 @@ export function OrderToJSON(value?: Order | null): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts index ecd7e174a20..2a0ca231c74 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts @@ -82,7 +82,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], 'photoUrls': json['photoUrls'], - 'tags': !exists(json, 'tags') ? undefined : (json['tags'] as Array).map(TagFromJSON), + 'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array).map(TagFromJSON)), 'status': !exists(json, 'status') ? undefined : json['status'], }; } @@ -100,7 +100,7 @@ export function PetToJSON(value?: Pet | null): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags === undefined ? undefined : ((value.tags as Array).map(TagToJSON)), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/documentation/asciidoc/.openapi-generator/VERSION b/samples/documentation/asciidoc/.openapi-generator/VERSION index 0e97bd19efb..d168f1d8bda 100644 --- a/samples/documentation/asciidoc/.openapi-generator/VERSION +++ b/samples/documentation/asciidoc/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/asciidoc/index.adoc b/samples/documentation/asciidoc/index.adoc index 148466dd320..5e174f0842f 100644 --- a/samples/documentation/asciidoc/index.adoc +++ b/samples/documentation/asciidoc/index.adoc @@ -6,9 +6,9 @@ team@openapitools.org :toclevels: 3 :source-highlighter: highlightjs :keywords: openapi, rest, OpenAPI Petstore -:specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation +:specDir: modules\openapi-generator\src\main\resources\asciidoc-documentation :snippetDir: . -:generator-template: v1 2019-09-03 +:generator-template: v1 2019-11-10 :info-url: https://openapi-generator.tech :app-name: OpenAPI Petstore @@ -17,7 +17,7 @@ team@openapitools.org This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -// markup not found, no include ::intro.adoc[] +// markup not found, no include ::intro.adoc[opts=optional] == Endpoints @@ -39,7 +39,7 @@ Add a new pet to the store -// markup not found, no include ::pet/POST/spec.adoc[] +// markup not found, no include ::pet/POST/spec.adoc[opts=optional] @@ -87,10 +87,10 @@ Add a new pet to the store ===== Samples -// markup not found, no include ::pet/POST/http-request.adoc[] +// markup not found, no include ::pet/POST/http-request.adoc[opts=optional] -// markup not found, no include ::pet/POST/http-response.adoc[] +// markup not found, no include ::pet/POST/http-response.adoc[opts=optional] @@ -100,7 +100,7 @@ Add a new pet to the store ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/POST/implementation.adoc[] +// markup not found, no include ::pet/POST/implementation.adoc[opts=optional] endif::internal-generation[] @@ -118,7 +118,7 @@ Deletes a pet -// markup not found, no include ::pet/{petId}/DELETE/spec.adoc[] +// markup not found, no include ::pet/{petId}/DELETE/spec.adoc[opts=optional] @@ -145,7 +145,7 @@ Deletes a pet |=== |Name| Description| Required| Default| Pattern -| apiKey +| api_key | | - | null @@ -179,10 +179,10 @@ Deletes a pet ===== Samples -// markup not found, no include ::pet/{petId}/DELETE/http-request.adoc[] +// markup not found, no include ::pet/{petId}/DELETE/http-request.adoc[opts=optional] -// markup not found, no include ::pet/{petId}/DELETE/http-response.adoc[] +// markup not found, no include ::pet/{petId}/DELETE/http-response.adoc[opts=optional] @@ -192,7 +192,7 @@ Deletes a pet ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/{petId}/DELETE/implementation.adoc[] +// markup not found, no include ::pet/{petId}/DELETE/implementation.adoc[opts=optional] endif::internal-generation[] @@ -210,7 +210,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings -// markup not found, no include ::pet/findByStatus/GET/spec.adoc[] +// markup not found, no include ::pet/findByStatus/GET/spec.adoc[opts=optional] @@ -266,10 +266,10 @@ array[<>] ===== Samples -// markup not found, no include ::pet/findByStatus/GET/http-request.adoc[] +// markup not found, no include ::pet/findByStatus/GET/http-request.adoc[opts=optional] -// markup not found, no include ::pet/findByStatus/GET/http-response.adoc[] +// markup not found, no include ::pet/findByStatus/GET/http-response.adoc[opts=optional] @@ -279,7 +279,7 @@ array[<>] ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/findByStatus/GET/implementation.adoc[] +// markup not found, no include ::pet/findByStatus/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -297,7 +297,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -// markup not found, no include ::pet/findByTags/GET/spec.adoc[] +// markup not found, no include ::pet/findByTags/GET/spec.adoc[opts=optional] @@ -353,10 +353,10 @@ array[<>] ===== Samples -// markup not found, no include ::pet/findByTags/GET/http-request.adoc[] +// markup not found, no include ::pet/findByTags/GET/http-request.adoc[opts=optional] -// markup not found, no include ::pet/findByTags/GET/http-response.adoc[] +// markup not found, no include ::pet/findByTags/GET/http-response.adoc[opts=optional] @@ -366,7 +366,7 @@ array[<>] ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/findByTags/GET/implementation.adoc[] +// markup not found, no include ::pet/findByTags/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -384,7 +384,7 @@ Find pet by ID Returns a single pet -// markup not found, no include ::pet/{petId}/GET/spec.adoc[] +// markup not found, no include ::pet/{petId}/GET/spec.adoc[opts=optional] @@ -445,10 +445,10 @@ Returns a single pet ===== Samples -// markup not found, no include ::pet/{petId}/GET/http-request.adoc[] +// markup not found, no include ::pet/{petId}/GET/http-request.adoc[opts=optional] -// markup not found, no include ::pet/{petId}/GET/http-response.adoc[] +// markup not found, no include ::pet/{petId}/GET/http-response.adoc[opts=optional] @@ -458,7 +458,7 @@ Returns a single pet ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/{petId}/GET/implementation.adoc[] +// markup not found, no include ::pet/{petId}/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -476,7 +476,7 @@ Update an existing pet -// markup not found, no include ::pet/PUT/spec.adoc[] +// markup not found, no include ::pet/PUT/spec.adoc[opts=optional] @@ -534,10 +534,10 @@ Update an existing pet ===== Samples -// markup not found, no include ::pet/PUT/http-request.adoc[] +// markup not found, no include ::pet/PUT/http-request.adoc[opts=optional] -// markup not found, no include ::pet/PUT/http-response.adoc[] +// markup not found, no include ::pet/PUT/http-response.adoc[opts=optional] @@ -547,7 +547,7 @@ Update an existing pet ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/PUT/implementation.adoc[] +// markup not found, no include ::pet/PUT/implementation.adoc[opts=optional] endif::internal-generation[] @@ -565,7 +565,7 @@ Updates a pet in the store with form data -// markup not found, no include ::pet/{petId}/POST/spec.adoc[] +// markup not found, no include ::pet/{petId}/POST/spec.adoc[opts=optional] @@ -613,10 +613,10 @@ Updates a pet in the store with form data ===== Samples -// markup not found, no include ::pet/{petId}/POST/http-request.adoc[] +// markup not found, no include ::pet/{petId}/POST/http-request.adoc[opts=optional] -// markup not found, no include ::pet/{petId}/POST/http-response.adoc[] +// markup not found, no include ::pet/{petId}/POST/http-response.adoc[opts=optional] @@ -626,7 +626,7 @@ Updates a pet in the store with form data ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/{petId}/POST/implementation.adoc[] +// markup not found, no include ::pet/{petId}/POST/implementation.adoc[opts=optional] endif::internal-generation[] @@ -644,7 +644,7 @@ uploads an image -// markup not found, no include ::pet/{petId}/uploadImage/POST/spec.adoc[] +// markup not found, no include ::pet/{petId}/uploadImage/POST/spec.adoc[opts=optional] @@ -694,10 +694,10 @@ uploads an image ===== Samples -// markup not found, no include ::pet/{petId}/uploadImage/POST/http-request.adoc[] +// markup not found, no include ::pet/{petId}/uploadImage/POST/http-request.adoc[opts=optional] -// markup not found, no include ::pet/{petId}/uploadImage/POST/http-response.adoc[] +// markup not found, no include ::pet/{petId}/uploadImage/POST/http-response.adoc[opts=optional] @@ -707,7 +707,7 @@ uploads an image ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::pet/{petId}/uploadImage/POST/implementation.adoc[] +// markup not found, no include ::pet/{petId}/uploadImage/POST/implementation.adoc[opts=optional] endif::internal-generation[] @@ -729,7 +729,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -// markup not found, no include ::store/order/{orderId}/DELETE/spec.adoc[] +// markup not found, no include ::store/order/{orderId}/DELETE/spec.adoc[opts=optional] @@ -782,10 +782,10 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ===== Samples -// markup not found, no include ::store/order/{orderId}/DELETE/http-request.adoc[] +// markup not found, no include ::store/order/{orderId}/DELETE/http-request.adoc[opts=optional] -// markup not found, no include ::store/order/{orderId}/DELETE/http-response.adoc[] +// markup not found, no include ::store/order/{orderId}/DELETE/http-response.adoc[opts=optional] @@ -795,7 +795,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::store/order/{orderId}/DELETE/implementation.adoc[] +// markup not found, no include ::store/order/{orderId}/DELETE/implementation.adoc[opts=optional] endif::internal-generation[] @@ -813,7 +813,7 @@ Returns pet inventories by status Returns a map of status codes to quantities -// markup not found, no include ::store/inventory/GET/spec.adoc[] +// markup not found, no include ::store/inventory/GET/spec.adoc[opts=optional] @@ -851,10 +851,10 @@ Returns a map of status codes to quantities ===== Samples -// markup not found, no include ::store/inventory/GET/http-request.adoc[] +// markup not found, no include ::store/inventory/GET/http-request.adoc[opts=optional] -// markup not found, no include ::store/inventory/GET/http-response.adoc[] +// markup not found, no include ::store/inventory/GET/http-response.adoc[opts=optional] @@ -864,7 +864,7 @@ Returns a map of status codes to quantities ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::store/inventory/GET/implementation.adoc[] +// markup not found, no include ::store/inventory/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -882,7 +882,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -// markup not found, no include ::store/order/{orderId}/GET/spec.adoc[] +// markup not found, no include ::store/order/{orderId}/GET/spec.adoc[opts=optional] @@ -943,10 +943,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ===== Samples -// markup not found, no include ::store/order/{orderId}/GET/http-request.adoc[] +// markup not found, no include ::store/order/{orderId}/GET/http-request.adoc[opts=optional] -// markup not found, no include ::store/order/{orderId}/GET/http-response.adoc[] +// markup not found, no include ::store/order/{orderId}/GET/http-response.adoc[opts=optional] @@ -956,7 +956,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::store/order/{orderId}/GET/implementation.adoc[] +// markup not found, no include ::store/order/{orderId}/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -974,7 +974,7 @@ Place an order for a pet -// markup not found, no include ::store/order/POST/spec.adoc[] +// markup not found, no include ::store/order/POST/spec.adoc[opts=optional] @@ -1030,10 +1030,10 @@ Place an order for a pet ===== Samples -// markup not found, no include ::store/order/POST/http-request.adoc[] +// markup not found, no include ::store/order/POST/http-request.adoc[opts=optional] -// markup not found, no include ::store/order/POST/http-response.adoc[] +// markup not found, no include ::store/order/POST/http-response.adoc[opts=optional] @@ -1043,7 +1043,7 @@ Place an order for a pet ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::store/order/POST/implementation.adoc[] +// markup not found, no include ::store/order/POST/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1065,7 +1065,7 @@ Create user This can only be done by the logged in user. -// markup not found, no include ::user/POST/spec.adoc[] +// markup not found, no include ::user/POST/spec.adoc[opts=optional] @@ -1113,10 +1113,10 @@ This can only be done by the logged in user. ===== Samples -// markup not found, no include ::user/POST/http-request.adoc[] +// markup not found, no include ::user/POST/http-request.adoc[opts=optional] -// markup not found, no include ::user/POST/http-response.adoc[] +// markup not found, no include ::user/POST/http-response.adoc[opts=optional] @@ -1126,7 +1126,7 @@ This can only be done by the logged in user. ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/POST/implementation.adoc[] +// markup not found, no include ::user/POST/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1144,7 +1144,7 @@ Creates list of users with given input array -// markup not found, no include ::user/createWithArray/POST/spec.adoc[] +// markup not found, no include ::user/createWithArray/POST/spec.adoc[opts=optional] @@ -1192,10 +1192,10 @@ Creates list of users with given input array ===== Samples -// markup not found, no include ::user/createWithArray/POST/http-request.adoc[] +// markup not found, no include ::user/createWithArray/POST/http-request.adoc[opts=optional] -// markup not found, no include ::user/createWithArray/POST/http-response.adoc[] +// markup not found, no include ::user/createWithArray/POST/http-response.adoc[opts=optional] @@ -1205,7 +1205,7 @@ Creates list of users with given input array ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/createWithArray/POST/implementation.adoc[] +// markup not found, no include ::user/createWithArray/POST/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1223,7 +1223,7 @@ Creates list of users with given input array -// markup not found, no include ::user/createWithList/POST/spec.adoc[] +// markup not found, no include ::user/createWithList/POST/spec.adoc[opts=optional] @@ -1271,10 +1271,10 @@ Creates list of users with given input array ===== Samples -// markup not found, no include ::user/createWithList/POST/http-request.adoc[] +// markup not found, no include ::user/createWithList/POST/http-request.adoc[opts=optional] -// markup not found, no include ::user/createWithList/POST/http-response.adoc[] +// markup not found, no include ::user/createWithList/POST/http-response.adoc[opts=optional] @@ -1284,7 +1284,7 @@ Creates list of users with given input array ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/createWithList/POST/implementation.adoc[] +// markup not found, no include ::user/createWithList/POST/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1302,7 +1302,7 @@ Delete user This can only be done by the logged in user. -// markup not found, no include ::user/{username}/DELETE/spec.adoc[] +// markup not found, no include ::user/{username}/DELETE/spec.adoc[opts=optional] @@ -1355,10 +1355,10 @@ This can only be done by the logged in user. ===== Samples -// markup not found, no include ::user/{username}/DELETE/http-request.adoc[] +// markup not found, no include ::user/{username}/DELETE/http-request.adoc[opts=optional] -// markup not found, no include ::user/{username}/DELETE/http-response.adoc[] +// markup not found, no include ::user/{username}/DELETE/http-response.adoc[opts=optional] @@ -1368,7 +1368,7 @@ This can only be done by the logged in user. ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/{username}/DELETE/implementation.adoc[] +// markup not found, no include ::user/{username}/DELETE/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1386,7 +1386,7 @@ Get user by user name -// markup not found, no include ::user/{username}/GET/spec.adoc[] +// markup not found, no include ::user/{username}/GET/spec.adoc[opts=optional] @@ -1447,10 +1447,10 @@ Get user by user name ===== Samples -// markup not found, no include ::user/{username}/GET/http-request.adoc[] +// markup not found, no include ::user/{username}/GET/http-request.adoc[opts=optional] -// markup not found, no include ::user/{username}/GET/http-response.adoc[] +// markup not found, no include ::user/{username}/GET/http-response.adoc[opts=optional] @@ -1460,7 +1460,7 @@ Get user by user name ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/{username}/GET/implementation.adoc[] +// markup not found, no include ::user/{username}/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1478,7 +1478,7 @@ Logs user into the system -// markup not found, no include ::user/login/GET/spec.adoc[] +// markup not found, no include ::user/login/GET/spec.adoc[opts=optional] @@ -1541,10 +1541,10 @@ Logs user into the system ===== Samples -// markup not found, no include ::user/login/GET/http-request.adoc[] +// markup not found, no include ::user/login/GET/http-request.adoc[opts=optional] -// markup not found, no include ::user/login/GET/http-response.adoc[] +// markup not found, no include ::user/login/GET/http-response.adoc[opts=optional] @@ -1554,7 +1554,7 @@ Logs user into the system ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/login/GET/implementation.adoc[] +// markup not found, no include ::user/login/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1572,7 +1572,7 @@ Logs out current logged in user session -// markup not found, no include ::user/logout/GET/spec.adoc[] +// markup not found, no include ::user/logout/GET/spec.adoc[opts=optional] @@ -1607,10 +1607,10 @@ Logs out current logged in user session ===== Samples -// markup not found, no include ::user/logout/GET/http-request.adoc[] +// markup not found, no include ::user/logout/GET/http-request.adoc[opts=optional] -// markup not found, no include ::user/logout/GET/http-response.adoc[] +// markup not found, no include ::user/logout/GET/http-response.adoc[opts=optional] @@ -1620,7 +1620,7 @@ Logs out current logged in user session ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/logout/GET/implementation.adoc[] +// markup not found, no include ::user/logout/GET/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1638,7 +1638,7 @@ Updated user This can only be done by the logged in user. -// markup not found, no include ::user/{username}/PUT/spec.adoc[] +// markup not found, no include ::user/{username}/PUT/spec.adoc[opts=optional] @@ -1704,10 +1704,10 @@ This can only be done by the logged in user. ===== Samples -// markup not found, no include ::user/{username}/PUT/http-request.adoc[] +// markup not found, no include ::user/{username}/PUT/http-request.adoc[opts=optional] -// markup not found, no include ::user/{username}/PUT/http-response.adoc[] +// markup not found, no include ::user/{username}/PUT/http-response.adoc[opts=optional] @@ -1717,7 +1717,7 @@ This can only be done by the logged in user. ifdef::internal-generation[] ===== Implementation -// markup not found, no include ::user/{username}/PUT/implementation.adoc[] +// markup not found, no include ::user/{username}/PUT/implementation.adoc[opts=optional] endif::internal-generation[] @@ -1728,7 +1728,7 @@ endif::internal-generation[] [#ApiResponse] -==== _ApiResponse_ An uploaded response +=== _ApiResponse_ An uploaded response Describes the result of uploading an image resource @@ -1741,25 +1741,25 @@ Describes the result of uploading an image resource | | Integer | -| int32 _ +| int32 | type | | String | -| _ +| | message | | String | -| _ +| |=== [#Category] -==== _Category_ Pet category +=== _Category_ Pet category A category for a pet @@ -1772,19 +1772,19 @@ A category for a pet | | Long | -| int64 _ +| int64 | name | | String | -| _ +| |=== [#Order] -==== _Order_ Pet Order +=== _Order_ Pet Order An order for a pets from the pet store @@ -1797,43 +1797,43 @@ An order for a pets from the pet store | | Long | -| int64 _ +| int64 | petId | | Long | -| int64 _ +| int64 | quantity | | Integer | -| int32 _ +| int32 | shipDate | | Date | -| date-time _ +| date-time | status | | String | Order Status -| Enum: _ placed, approved, delivered, _ +| _Enum:_ placed, approved, delivered, | complete | | Boolean | -| _ +| |=== [#Pet] -==== _Pet_ a Pet +=== _Pet_ a Pet A pet for sale in the pet store @@ -1846,43 +1846,43 @@ A pet for sale in the pet store | | Long | -| int64 _ +| int64 | category | | Category | -| _ +| | name | X | String | -| _ +| | photoUrls | X | List of <> | -| _ +| | tags | | List of <> | -| _ +| | status | | String | pet status in the store -| Enum: _ available, pending, sold, _ +| _Enum:_ available, pending, sold, |=== [#Tag] -==== _Tag_ Pet Tag +=== _Tag_ Pet Tag A tag for a pet @@ -1895,19 +1895,19 @@ A tag for a pet | | Long | -| int64 _ +| int64 | name | | String | -| _ +| |=== [#User] -==== _User_ a User +=== _User_ a User A User who is purchasing from the pet store @@ -1920,49 +1920,49 @@ A User who is purchasing from the pet store | | Long | -| int64 _ +| int64 | username | | String | -| _ +| | firstName | | String | -| _ +| | lastName | | String | -| _ +| | email | | String | -| _ +| | password | | String | -| _ +| | phone | | String | -| _ +| | userStatus | | Integer | User Status -| int32 _ +| int32 |=== diff --git a/samples/meta-codegen-kotlin/.gitignore b/samples/meta-codegen-kotlin/.gitignore new file mode 100644 index 00000000000..eb30a7a3eb7 --- /dev/null +++ b/samples/meta-codegen-kotlin/.gitignore @@ -0,0 +1,23 @@ +# Created by https://www.gitignore.io/api/gradle +# Edit at https://www.gitignore.io/?templates=gradle + +### Gradle ### +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +#!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +### Gradle Patch ### +**/build/ + +# End of https://www.gitignore.io/api/gradle diff --git a/samples/meta-codegen-kotlin/gradle/wrapper/gradle-wrapper.properties b/samples/meta-codegen-kotlin/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..7c4388a9216 --- /dev/null +++ b/samples/meta-codegen-kotlin/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/meta-codegen-kotlin/gradlew b/samples/meta-codegen-kotlin/gradlew new file mode 100755 index 00000000000..2fe81a7d95e --- /dev/null +++ b/samples/meta-codegen-kotlin/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/meta-codegen-kotlin/gradlew.bat b/samples/meta-codegen-kotlin/gradlew.bat new file mode 100644 index 00000000000..24467a141f7 --- /dev/null +++ b/samples/meta-codegen-kotlin/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/meta-codegen-kotlin/lib/README.md b/samples/meta-codegen-kotlin/lib/README.md new file mode 100644 index 00000000000..ed9aa572f29 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/README.md @@ -0,0 +1,60 @@ +# my-client-codegen-openapi-generator + +## Requirements + +* Gradle 5.x +* Java 8+ + +## Getting Started + +* Initialize the gradle wrapper: + ```bash + gradle wrapper --gradle-version 5.6.2 + ``` +* Modify the codegen class and associated templates +* Compile with `./gradlew standalone` +* Verify: + ```bash + java -jar build/libs/my-client-codegen-openapi-generator-standalone.jar config-help -g myClientCodegen + ``` + +## Building + +### Standalone + +As seen in "Getting Started", the generator may be built as a standalone customized version of OpenAPI Generator's CLI. This may be the simplest option for developers who are unfamiliar with working in the JVM. Please be aware of any licensing concerns before distributing this "uber-jar". + +To build as a standalone, run: + +```bash +./gradlew standalone +``` + +To list generators via OpenAPI Generator CLI: + +```bash +java -jar build/libs/my-client-codegen-openapi-generator-standalone.jar list --include all +``` + +### ShadowJar + +This generator supports building as a lightweight "fat-jar". This option includes Kotlin or any other `implementation` dependencies you'll add. This will simplify publishing if your generator has many dependencies. + +To build as a shadowJar, run: + +```bash +./gradlew shadowJar +``` + +To list generators via OpenAPI Generator CLI, you must refer to the CLI jar explicitly. We add a custom copy task which includes the CLI jar in the build output directory: + +```bash +java -cp build/libs/openapi-generator-cli-4.1.3.jar:build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar org.openapitools.codegen.OpenAPIGenerator list +``` + +Notice that this command _must_ pass classpath via `-cp` and include OpenAPI Generator CLI as well as the artifact built from this project. Also notice that the manifest class must be passed explicitly as `org.openapitools.codegen.OpenAPIGenerator`. + +## See Also + +* [Customization docs](https://openapi-generator.tech/docs/customization) +* [Templating docs](https://openapi-generator.tech/docs/templating) diff --git a/samples/meta-codegen-kotlin/lib/build.gradle.kts b/samples/meta-codegen-kotlin/lib/build.gradle.kts new file mode 100644 index 00000000000..d3368ff515e --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/build.gradle.kts @@ -0,0 +1,62 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") version "1.3.41" + id("com.github.johnrengelman.shadow") version("5.0.0") +} + +group = "org.openapitools" +version = "1.0-SNAPSHOT" + +repositories { + mavenLocal() + mavenCentral() +} + +dependencies { + val openapiGeneratorVersion = "4.1.3" + + implementation(kotlin("stdlib-jdk8")) + implementation("org.openapitools:openapi-generator:$openapiGeneratorVersion") + + runtime("org.openapitools:openapi-generator-cli:$openapiGeneratorVersion") + + testImplementation("org.junit.jupiter:junit-jupiter:5.5.2") +} + +tasks.test { + useJUnitPlatform() + testLogging { + events("passed", "skipped", "failed") + } +} + +tasks.register("copyToLib") { + from(project.configurations.runtime) + into(File(buildDir, "libs")) +} + +tasks.register("standalone") { + archiveFileName.set("myClientCodegen-openapi-generator-standalone.jar") + archiveClassifier.set("all") + + from(sourceSets["main"].output) + + configurations.add(project.configurations["runtimeClasspath"]) + configurations.add(project.configurations["runtime"]) + + mergeServiceFiles() + + manifest.attributes(mapOf("Main-Class" to "org.openapitools.codegen.OpenAPIGenerator")) +} + +tasks.withType { + kotlinOptions.jvmTarget = "1.8" +} + +tasks.wrapper { + this.distributionType = Wrapper.DistributionType.BIN +} + +tasks.named("shadowJar") { dependsOn("copyToLib") } diff --git a/samples/meta-codegen-kotlin/lib/gradle.properties b/samples/meta-codegen-kotlin/lib/gradle.properties new file mode 100644 index 00000000000..7fc6f1ff272 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official diff --git a/samples/meta-codegen-kotlin/lib/gradle/wrapper/gradle-wrapper.properties b/samples/meta-codegen-kotlin/lib/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..7c4388a9216 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/meta-codegen-kotlin/lib/gradlew b/samples/meta-codegen-kotlin/lib/gradlew new file mode 100755 index 00000000000..2fe81a7d95e --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/meta-codegen-kotlin/lib/settings.gradle b/samples/meta-codegen-kotlin/lib/settings.gradle new file mode 100644 index 00000000000..2faa1176a29 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'my-client-codegen-openapi-generator' diff --git a/samples/meta-codegen-kotlin/lib/src/main/kotlin/com/my/company/codegen/MyclientcodegenGenerator.kt b/samples/meta-codegen-kotlin/lib/src/main/kotlin/com/my/company/codegen/MyclientcodegenGenerator.kt new file mode 100644 index 00000000000..3ca0a620f9d --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/src/main/kotlin/com/my/company/codegen/MyclientcodegenGenerator.kt @@ -0,0 +1,183 @@ +@file:JvmName("MyclientcodegenGenerator") +package com.my.company.codegen + +import org.openapitools.codegen.* + +import java.util.* +import java.io.File + +open class MyclientcodegenGenerator() : DefaultCodegen(), CodegenConfig { + + // source folder where files are written + private var sourceFolder = "src" + private var apiVersion = "1.0.0" + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see org.openapitools.codegen.CodegenType + */ + override fun getTag(): CodegenType { + return CodegenType.DOCUMENTATION + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + override fun getName(): String { + return "myClientCodegen" + } + + /** + * Provides an opportunity to inspect and modify operation data before the code is generated. + */ + @Suppress("UNCHECKED_CAST") + override fun postProcessOperationsWithModels(objs: Map, allModels: List?): Map { + val results = super.postProcessOperationsWithModels(objs, allModels) + + val ops = results["operations"] as Map + val opList = ops["operation"] as ArrayList + + // iterate over the operation and perhaps modify something + for (co: CodegenOperation in opList) { + // example: + // co.httpMethod = co.httpMethod.toLowerCase(); + } + + return results + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + override fun getHelp(): String { + return "Generates a myClientCodegen client library." + } + + init { + // set the output folder here + outputFolder = "generated-code/myClientCodegen" + + /** + * Models. You can write model files using the modelTemplateFiles map. + * if you want to create one template for file, you can do so here. + * for multiple files for model, just put another entry in the `modelTemplateFiles` with + * a different extension + */ + modelTemplateFiles["model.mustache"] = ".sample" // the extension for each file to write + + /** + * Api classes. You can write classes for each Api file with the apiTemplateFiles map. + * as with models, add multiple entries with different extensions for multiple files per + * class + */ + apiTemplateFiles["api.mustache"] = ".sample" // the extension for each file to write + + /** + * Template Location. This is the location which templates will be read from. The generator + * will use the resource stream to attempt to read the templates. + */ + templateDir = "myClientCodegen" + + /** + * Api Package. Optional, if needed, this can be used in templates + */ + apiPackage = "org.openapitools.api" + + /** + * Model Package. Optional, if needed, this can be used in templates + */ + modelPackage = "org.openapitools.model" + + /** + * Reserved words. Override this with reserved words specific to your language + */ + reservedWords = HashSet( + listOf("sample1", "sample2") + ) + + /** + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties["apiVersion"] = apiVersion + + /** + * Supporting Files. You can write single files for the generator with the + * entire object tree available. If the input file has a suffix of `.mustache + * it will be processed by the template engine. Otherwise, it will be copied + */ + supportingFiles.add( + SupportingFile( + "myFile.mustache", // the input template or file + "", // the destination folder, relative `outputFolder` + "myFile.sample" + ) // the output file + ) + + /** + * Language Specific Primitives. These types will not trigger imports by + * the client generator + */ + languageSpecificPrimitives = HashSet( + listOf("Type1", "Type2") + ) + } + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping + * those terms here. This logic is only called if a variable matches the reserved words + * + * @return the escaped term + */ + override fun escapeReservedWord(name: String?): String { + // add an underscore to the name if it exists. + return if (name == null) "" else "_$name" + } + + /** + * Location to write model files. You can use the modelPackage() as defined when the class is + * instantiated + */ + override fun modelFileFolder(): String { + return """$outputFolder/$sourceFolder/${modelPackage().replace('.', File.separatorChar)}""" + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + override fun apiFileFolder(): String { + return """$outputFolder/$sourceFolder/${apiPackage().replace('.', File.separatorChar)}""" + } + + /** + * override with any special text escaping logic to handle unsafe + * characters so as to avoid code injection + * + * @param input String to be cleaned up + * @return string with unsafe characters removed or escaped + */ + override fun escapeUnsafeCharacters(input: String): String { + //TODO: check that this logic is safe to escape unsafe characters to avoid code injection + return input + } + + /** + * Escape single and/or double quote to avoid code injection + * + * @param input String to be cleaned up + * @return string with quotation mark removed or escaped + */ + override fun escapeQuotationMark(input: String): String { + //TODO: check that this logic is safe to escape quotation mark to avoid code injection + return with(input) { replace("\"", "\\\"") } + } +} \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/lib/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/samples/meta-codegen-kotlin/lib/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig new file mode 100644 index 00000000000..c59c7d7efc4 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -0,0 +1 @@ +com.my.company.codegen.MyclientcodegenGenerator \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/api.mustache b/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/api.mustache new file mode 100644 index 00000000000..62802f7f1e7 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/api.mustache @@ -0,0 +1,28 @@ + +# This is a sample api mustache template. It is representing a ficticous +# language and won't be usable or compile to anything without lots of changes. +# Use it as an example. You can access the variables in the generator object +# like such: + +# use the package from the `apiPackage` variable +package: {{package}} + +# operations block +{{#operations}} +classname: {{classname}} + +# loop over each operation in the API: +{{#operation}} + +# each operation has an `operationId`: +operationId: {{operationId}} + +# and parameters: +{{#allParams}} +{{paramName}}: {{dataType}} +{{/allParams}} + +{{/operation}} + +# end of operations block +{{/operations}} \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/model.mustache b/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/model.mustache new file mode 100644 index 00000000000..143f30f5be0 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/model.mustache @@ -0,0 +1 @@ +# This is a sample model mustache template. \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/myFile.mustache b/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/myFile.mustache new file mode 100644 index 00000000000..6421ab03f86 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/src/main/resources/myClientCodegen/myFile.mustache @@ -0,0 +1 @@ +# This is a sample supporting file mustache template. \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/lib/src/test/kotlin/com/my/company/codegen/MyclientcodegenGeneratorTest.kt b/samples/meta-codegen-kotlin/lib/src/test/kotlin/com/my/company/codegen/MyclientcodegenGeneratorTest.kt new file mode 100644 index 00000000000..3ebf1576b25 --- /dev/null +++ b/samples/meta-codegen-kotlin/lib/src/test/kotlin/com/my/company/codegen/MyclientcodegenGeneratorTest.kt @@ -0,0 +1,26 @@ +package com.my.company.codegen + +import org.junit.jupiter.api.Assertions.* +import org.junit.jupiter.api.Test +import org.openapitools.codegen.ClientOptInput +import org.openapitools.codegen.DefaultGenerator +import org.openapitools.codegen.config.CodegenConfigurator + +internal class MyclientcodegenGeneratorTest { + + // use this test to launch you code generator in the debugger. + // this allows you to easily set break points in MyclientcodegenGenerator. + @Test + fun launchCodeGenerator() { + // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + val configurator: CodegenConfigurator = CodegenConfigurator() + .setGeneratorName("myClientCodegen") + .setInputSpec("https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server + .setOutputDir("out/myClientCodegen") + + val clientOptInput: ClientOptInput = configurator.toClientOptInput() + val generator = DefaultGenerator() + generator.opts(clientOptInput).generate() + } +} \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/usage/.openapi-generator-ignore b/samples/meta-codegen-kotlin/usage/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/meta-codegen-kotlin/usage/.openapi-generator/VERSION b/samples/meta-codegen-kotlin/usage/.openapi-generator/VERSION new file mode 100644 index 00000000000..717311e32e3 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/.openapi-generator/VERSION @@ -0,0 +1 @@ +unset \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/usage/myFile.sample b/samples/meta-codegen-kotlin/usage/myFile.sample new file mode 100644 index 00000000000..6421ab03f86 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/myFile.sample @@ -0,0 +1 @@ +# This is a sample supporting file mustache template. \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/PetApi.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/PetApi.sample new file mode 100644 index 00000000000..e75a6149341 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/PetApi.sample @@ -0,0 +1,76 @@ + +# This is a sample api mustache template. It is representing a ficticous +# language and won't be usable or compile to anything without lots of changes. +# Use it as an example. You can access the variables in the generator object +# like such: + +# use the package from the `apiPackage` variable +package: org.openapitools.api + +# operations block +classname: PetApi + +# loop over each operation in the API: + +# each operation has an `operationId`: +operationId: addPet + +# and parameters: +body: Pet + + +# each operation has an `operationId`: +operationId: deletePet + +# and parameters: +petId: Long +apiKey: String + + +# each operation has an `operationId`: +operationId: findPetsByStatus + +# and parameters: +status: List + + +# each operation has an `operationId`: +operationId: findPetsByTags + +# and parameters: +tags: List + + +# each operation has an `operationId`: +operationId: getPetById + +# and parameters: +petId: Long + + +# each operation has an `operationId`: +operationId: updatePet + +# and parameters: +body: Pet + + +# each operation has an `operationId`: +operationId: updatePetWithForm + +# and parameters: +petId: String +name: String +status: String + + +# each operation has an `operationId`: +operationId: uploadFile + +# and parameters: +petId: Long +additionalMetadata: String +file: File + + +# end of operations block diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/StoreApi.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/StoreApi.sample new file mode 100644 index 00000000000..298e7edbb0f --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/StoreApi.sample @@ -0,0 +1,42 @@ + +# This is a sample api mustache template. It is representing a ficticous +# language and won't be usable or compile to anything without lots of changes. +# Use it as an example. You can access the variables in the generator object +# like such: + +# use the package from the `apiPackage` variable +package: org.openapitools.api + +# operations block +classname: StoreApi + +# loop over each operation in the API: + +# each operation has an `operationId`: +operationId: deleteOrder + +# and parameters: +orderId: String + + +# each operation has an `operationId`: +operationId: getInventory + +# and parameters: + + +# each operation has an `operationId`: +operationId: getOrderById + +# and parameters: +orderId: String + + +# each operation has an `operationId`: +operationId: placeOrder + +# and parameters: +body: Order + + +# end of operations block diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/UserApi.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/UserApi.sample new file mode 100644 index 00000000000..ebc744ed975 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/UserApi.sample @@ -0,0 +1,72 @@ + +# This is a sample api mustache template. It is representing a ficticous +# language and won't be usable or compile to anything without lots of changes. +# Use it as an example. You can access the variables in the generator object +# like such: + +# use the package from the `apiPackage` variable +package: org.openapitools.api + +# operations block +classname: UserApi + +# loop over each operation in the API: + +# each operation has an `operationId`: +operationId: createUser + +# and parameters: +body: User + + +# each operation has an `operationId`: +operationId: createUsersWithArrayInput + +# and parameters: +body: List + + +# each operation has an `operationId`: +operationId: createUsersWithListInput + +# and parameters: +body: List + + +# each operation has an `operationId`: +operationId: deleteUser + +# and parameters: +username: String + + +# each operation has an `operationId`: +operationId: getUserByName + +# and parameters: +username: String + + +# each operation has an `operationId`: +operationId: loginUser + +# and parameters: +username: String +password: String + + +# each operation has an `operationId`: +operationId: logoutUser + +# and parameters: + + +# each operation has an `operationId`: +operationId: updateUser + +# and parameters: +username: String +body: User + + +# end of operations block diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Category.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Category.sample new file mode 100644 index 00000000000..143f30f5be0 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Category.sample @@ -0,0 +1 @@ +# This is a sample model mustache template. \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Order.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Order.sample new file mode 100644 index 00000000000..143f30f5be0 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Order.sample @@ -0,0 +1 @@ +# This is a sample model mustache template. \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Pet.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Pet.sample new file mode 100644 index 00000000000..143f30f5be0 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Pet.sample @@ -0,0 +1 @@ +# This is a sample model mustache template. \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Tag.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Tag.sample new file mode 100644 index 00000000000..143f30f5be0 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/Tag.sample @@ -0,0 +1 @@ +# This is a sample model mustache template. \ No newline at end of file diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/User.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/User.sample new file mode 100644 index 00000000000..143f30f5be0 --- /dev/null +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/model/User.sample @@ -0,0 +1 @@ +# This is a sample model mustache template. \ No newline at end of file diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index f4411133f5f..2b994a5b0be 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,11 @@ UTF-8 +<<<<<<< HEAD 5.0.0-SNAPSHOT +======= + 4.3.0-SNAPSHOT +>>>>>>> 4.3.x 1.0.0 4.8.1 diff --git a/samples/meta-codegen/usage/.openapi-generator/VERSION b/samples/meta-codegen/usage/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/openapi3/client/composition/elm/.gitignore b/samples/openapi3/client/composition/elm/.gitignore new file mode 100644 index 00000000000..8b0d053e4e3 --- /dev/null +++ b/samples/openapi3/client/composition/elm/.gitignore @@ -0,0 +1 @@ +/elm-stuff \ No newline at end of file diff --git a/samples/openapi3/client/composition/elm/.openapi-generator-ignore b/samples/openapi3/client/composition/elm/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/composition/elm/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/composition/elm/.openapi-generator/VERSION b/samples/openapi3/client/composition/elm/.openapi-generator/VERSION new file mode 100644 index 00000000000..d168f1d8bda --- /dev/null +++ b/samples/openapi3/client/composition/elm/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/composition/elm/README.md b/samples/openapi3/client/composition/elm/README.md new file mode 100644 index 00000000000..c088cadbea3 --- /dev/null +++ b/samples/openapi3/client/composition/elm/README.md @@ -0,0 +1,10 @@ +# Elm API client + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build package: org.openapitools.codegen.languages.ElmClientCodegen diff --git a/samples/openapi3/client/composition/elm/elm-compile-test b/samples/openapi3/client/composition/elm/elm-compile-test new file mode 100755 index 00000000000..55507cfcad6 --- /dev/null +++ b/samples/openapi3/client/composition/elm/elm-compile-test @@ -0,0 +1,14 @@ +#!/bin/bash -e +# elm make all elm files under src + +for ELM in `find src -name "*.elm"` +do + echo "Compiling $ELM" + elm make $ELM --output /dev/null + rc=$? + if [[ $rc != 0 ]] + then + echo "ERROR!! FAILED TO COMPILE $ELM" + exit $rc; + fi +done diff --git a/samples/openapi3/client/composition/elm/elm.json b/samples/openapi3/client/composition/elm/elm.json new file mode 100644 index 00000000000..398da0d2d6d --- /dev/null +++ b/samples/openapi3/client/composition/elm/elm.json @@ -0,0 +1,33 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.0", + "dependencies": { + "direct": { + "NoRedInk/elm-json-decode-pipeline": "1.0.0", + "danyx23/elm-uuid": "2.1.2", + "elm/browser": "1.0.1", + "elm/core": "1.0.2", + "elm/html": "1.0.0", + "elm/http": "2.0.0", + "elm/json": "1.1.2", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "rtfeldman/elm-iso8601-date-strings": "1.1.3" + }, + "indirect": { + "elm/bytes": "1.0.5", + "elm/file": "1.0.1", + "elm/parser": "1.1.0", + "elm/random": "1.0.0", + "elm/regex": "1.0.0", + "elm/virtual-dom": "1.0.2" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} diff --git a/samples/openapi3/client/composition/elm/pom.xml b/samples/openapi3/client/composition/elm/pom.xml new file mode 100644 index 00000000000..c70a1f0b874 --- /dev/null +++ b/samples/openapi3/client/composition/elm/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + org.openapitools + ElmCompositionTests + pom + 1.0-SNAPSHOT + Elm Composition Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + ./elm-compile-test + + + + + + + diff --git a/samples/openapi3/client/composition/elm/src/Byte.elm b/samples/openapi3/client/composition/elm/src/Byte.elm new file mode 100644 index 00000000000..d83623d9846 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Byte.elm @@ -0,0 +1,18 @@ +module Byte exposing (Byte, decoder, encode) + +import Json.Decode as Decode exposing (Decoder) +import Json.Encode as Encode + + +type alias Byte = + String + + +decoder : Decoder Byte +decoder = + Decode.string + + +encode : Byte -> Encode.Value +encode model = + Encode.string model diff --git a/samples/openapi3/client/composition/elm/src/Data/AllOf.elm b/samples/openapi3/client/composition/elm/src/Data/AllOf.elm new file mode 100644 index 00000000000..d5365028afa --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/AllOf.elm @@ -0,0 +1,56 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.AllOf exposing (AllOf, decoder, encode, encodeWithTag, toString) + +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type alias AllOf = + { objectType : String + , valueA : Maybe String + , valueB : Maybe Float + } + + +decoder : Decoder AllOf +decoder = + Decode.succeed AllOf + |> required "objectType" Decode.string + |> optional "valueA" (Decode.nullable Decode.string) Nothing + |> optional "valueB" (Decode.nullable Decode.float) Nothing + + +encode : AllOf -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> AllOf -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : AllOf -> List ( String, Encode.Value ) +encodePairs model = + [ ( "objectType", Encode.string model.objectType ) + , ( "valueA", Maybe.withDefault Encode.null (Maybe.map Encode.string model.valueA) ) + , ( "valueB", Maybe.withDefault Encode.null (Maybe.map Encode.float model.valueB) ) + ] + + +toString : AllOf -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/BaseObject.elm b/samples/openapi3/client/composition/elm/src/Data/BaseObject.elm new file mode 100644 index 00000000000..b81d6f75864 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/BaseObject.elm @@ -0,0 +1,59 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.BaseObject exposing (BaseObject(..), decoder, encode, toString) + +import Data.SubObjectA as SubObjectA exposing (SubObjectA) +import Data.SubObjectB as SubObjectB exposing (SubObjectB) +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type BaseObject + = SubObjectAType SubObjectA + | SubObjectBType SubObjectB + + +decoder : Decoder BaseObject +decoder = + Decode.field "objectType" Decode.string + |> Decode.andThen baseObjectDecoder + + +baseObjectDecoder : String -> Decoder BaseObject +baseObjectDecoder tag = + case tag of + "SubObjectA" -> + Decode.map SubObjectAType SubObjectA.decoder + + "SubObjectB" -> + Decode.map SubObjectBType SubObjectB.decoder + + _ -> + Decode.fail <| "Trying to decode BaseObject, but objectType '" ++ tag ++ "' is not supported." + + +encode : BaseObject -> Encode.Value +encode model = + case model of + SubObjectAType subModel -> + SubObjectA.encodeWithTag ( "objectType", "SubObjectA" ) subModel + + SubObjectBType subModel -> + SubObjectB.encodeWithTag ( "objectType", "SubObjectB" ) subModel + + +toString : BaseObject -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/ObjectA.elm b/samples/openapi3/client/composition/elm/src/Data/ObjectA.elm new file mode 100644 index 00000000000..9a9ba64da51 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/ObjectA.elm @@ -0,0 +1,53 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.ObjectA exposing (ObjectA, decoder, encode, encodeWithTag, toString) + +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type alias ObjectA = + { objectType : String + , valueA : Maybe String + } + + +decoder : Decoder ObjectA +decoder = + Decode.succeed ObjectA + |> required "objectType" Decode.string + |> optional "valueA" (Decode.nullable Decode.string) Nothing + + +encode : ObjectA -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> ObjectA -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : ObjectA -> List ( String, Encode.Value ) +encodePairs model = + [ ( "objectType", Encode.string model.objectType ) + , ( "valueA", Maybe.withDefault Encode.null (Maybe.map Encode.string model.valueA) ) + ] + + +toString : ObjectA -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/ObjectB.elm b/samples/openapi3/client/composition/elm/src/Data/ObjectB.elm new file mode 100644 index 00000000000..0ffa826106e --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/ObjectB.elm @@ -0,0 +1,53 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.ObjectB exposing (ObjectB, decoder, encode, encodeWithTag, toString) + +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type alias ObjectB = + { objectType : String + , valueB : Maybe Float + } + + +decoder : Decoder ObjectB +decoder = + Decode.succeed ObjectB + |> required "objectType" Decode.string + |> optional "valueB" (Decode.nullable Decode.float) Nothing + + +encode : ObjectB -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> ObjectB -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : ObjectB -> List ( String, Encode.Value ) +encodePairs model = + [ ( "objectType", Encode.string model.objectType ) + , ( "valueB", Maybe.withDefault Encode.null (Maybe.map Encode.float model.valueB) ) + ] + + +toString : ObjectB -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/OneOf.elm b/samples/openapi3/client/composition/elm/src/Data/OneOf.elm new file mode 100644 index 00000000000..5bd3b463056 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/OneOf.elm @@ -0,0 +1,48 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.OneOf exposing (OneOf, decoder, encode, toString) + +import Data.ObjectA as ObjectA exposing (ObjectA) +import Data.ObjectB as ObjectB exposing (ObjectB) +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type OneOf + = ObjectAType ObjectA + | ObjectBType ObjectB + + +decoder : Decoder OneOf +decoder = + Decode.oneOf + [ Decode.map ObjectAType ObjectA.decoder + , Decode.map ObjectBType ObjectB.decoder + ] + + +encode : OneOf -> Encode.Value +encode model = + case model of + ObjectAType subModel -> + ObjectA.encode subModel + + ObjectBType subModel -> + ObjectB.encode subModel + + +toString : OneOf -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/OneOfWithAllOfDiscriminator.elm b/samples/openapi3/client/composition/elm/src/Data/OneOfWithAllOfDiscriminator.elm new file mode 100644 index 00000000000..6e43730e0f7 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/OneOfWithAllOfDiscriminator.elm @@ -0,0 +1,48 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.OneOfWithAllOfDiscriminator exposing (OneOfWithAllOfDiscriminator, decoder, encode, toString) + +import Data.SubObjectA as SubObjectA exposing (SubObjectA) +import Data.SubObjectB as SubObjectB exposing (SubObjectB) +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type OneOfWithAllOfDiscriminator + = SubObjectAType SubObjectA + | SubObjectBType SubObjectB + + +decoder : Decoder OneOfWithAllOfDiscriminator +decoder = + Decode.oneOf + [ Decode.map SubObjectAType SubObjectA.decoder + , Decode.map SubObjectBType SubObjectB.decoder + ] + + +encode : OneOfWithAllOfDiscriminator -> Encode.Value +encode model = + case model of + SubObjectAType subModel -> + SubObjectA.encode subModel + + SubObjectBType subModel -> + SubObjectB.encode subModel + + +toString : OneOfWithAllOfDiscriminator -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/OneOfWithDiscriminator.elm b/samples/openapi3/client/composition/elm/src/Data/OneOfWithDiscriminator.elm new file mode 100644 index 00000000000..a45536791e7 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/OneOfWithDiscriminator.elm @@ -0,0 +1,59 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.OneOfWithDiscriminator exposing (OneOfWithDiscriminator, decoder, encode, toString) + +import Data.ObjectA as ObjectA exposing (ObjectA) +import Data.ObjectB as ObjectB exposing (ObjectB) +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type OneOfWithDiscriminator + = ObjectAType ObjectA + | ObjectBType ObjectB + + +decoder : Decoder OneOfWithDiscriminator +decoder = + Decode.field "objectType" Decode.string + |> Decode.andThen oneOfWithDiscriminatorDecoder + + +oneOfWithDiscriminatorDecoder : String -> Decoder OneOfWithDiscriminator +oneOfWithDiscriminatorDecoder tag = + case tag of + "a" -> + Decode.map ObjectAType ObjectA.decoder + + "b" -> + Decode.map ObjectBType ObjectB.decoder + + _ -> + Decode.fail <| "Trying to decode OneOfWithDiscriminator, but objectType '" ++ tag ++ "' is not supported." + + +encode : OneOfWithDiscriminator -> Encode.Value +encode model = + case model of + ObjectAType subModel -> + ObjectA.encodeWithTag ( "objectType", "a" ) subModel + + ObjectBType subModel -> + ObjectB.encodeWithTag ( "objectType", "b" ) subModel + + +toString : OneOfWithDiscriminator -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/SubObjectA.elm b/samples/openapi3/client/composition/elm/src/Data/SubObjectA.elm new file mode 100644 index 00000000000..beb5b335ce0 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/SubObjectA.elm @@ -0,0 +1,53 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.SubObjectA exposing (SubObjectA, decoder, encode, encodeWithTag, toString) + +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type alias SubObjectA = + { value : Bool + , valueA : Maybe String + } + + +decoder : Decoder SubObjectA +decoder = + Decode.succeed SubObjectA + |> required "value" Decode.bool + |> optional "valueA" (Decode.nullable Decode.string) Nothing + + +encode : SubObjectA -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> SubObjectA -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : SubObjectA -> List ( String, Encode.Value ) +encodePairs model = + [ ( "value", Encode.bool model.value ) + , ( "valueA", Maybe.withDefault Encode.null (Maybe.map Encode.string model.valueA) ) + ] + + +toString : SubObjectA -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/SubObjectAAllOf.elm b/samples/openapi3/client/composition/elm/src/Data/SubObjectAAllOf.elm new file mode 100644 index 00000000000..dbebf152361 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/SubObjectAAllOf.elm @@ -0,0 +1,50 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.SubObjectAAllOf exposing (SubObjectAAllOf, decoder, encode, encodeWithTag, toString) + +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type alias SubObjectAAllOf = + { valueA : Maybe String + } + + +decoder : Decoder SubObjectAAllOf +decoder = + Decode.succeed SubObjectAAllOf + |> optional "valueA" (Decode.nullable Decode.string) Nothing + + +encode : SubObjectAAllOf -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> SubObjectAAllOf -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : SubObjectAAllOf -> List ( String, Encode.Value ) +encodePairs model = + [ ( "valueA", Maybe.withDefault Encode.null (Maybe.map Encode.string model.valueA) ) + ] + + +toString : SubObjectAAllOf -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/SubObjectB.elm b/samples/openapi3/client/composition/elm/src/Data/SubObjectB.elm new file mode 100644 index 00000000000..77c7d9f87ce --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/SubObjectB.elm @@ -0,0 +1,53 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.SubObjectB exposing (SubObjectB, decoder, encode, encodeWithTag, toString) + +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type alias SubObjectB = + { value : Bool + , valueB : Maybe Float + } + + +decoder : Decoder SubObjectB +decoder = + Decode.succeed SubObjectB + |> required "value" Decode.bool + |> optional "valueB" (Decode.nullable Decode.float) Nothing + + +encode : SubObjectB -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> SubObjectB -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : SubObjectB -> List ( String, Encode.Value ) +encodePairs model = + [ ( "value", Encode.bool model.value ) + , ( "valueB", Maybe.withDefault Encode.null (Maybe.map Encode.float model.valueB) ) + ] + + +toString : SubObjectB -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/Data/SubObjectBAllOf.elm b/samples/openapi3/client/composition/elm/src/Data/SubObjectBAllOf.elm new file mode 100644 index 00000000000..6983e8cbbb3 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Data/SubObjectBAllOf.elm @@ -0,0 +1,50 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Data.SubObjectBAllOf exposing (SubObjectBAllOf, decoder, encode, encodeWithTag, toString) + +import Dict exposing (Dict) +import Json.Decode as Decode exposing (Decoder) +import Json.Decode.Pipeline exposing (optional, required) +import Json.Encode as Encode + + +type alias SubObjectBAllOf = + { valueB : Maybe Float + } + + +decoder : Decoder SubObjectBAllOf +decoder = + Decode.succeed SubObjectBAllOf + |> optional "valueB" (Decode.nullable Decode.float) Nothing + + +encode : SubObjectBAllOf -> Encode.Value +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> SubObjectBAllOf -> Encode.Value +encodeWithTag ( tagField, tag ) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : SubObjectBAllOf -> List ( String, Encode.Value ) +encodePairs model = + [ ( "valueB", Maybe.withDefault Encode.null (Maybe.map Encode.float model.valueB) ) + ] + + +toString : SubObjectBAllOf -> String +toString = + Encode.encode 0 << encode diff --git a/samples/openapi3/client/composition/elm/src/DateOnly.elm b/samples/openapi3/client/composition/elm/src/DateOnly.elm new file mode 100644 index 00000000000..a31efc88c38 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/DateOnly.elm @@ -0,0 +1,37 @@ +module DateOnly exposing (DateOnly, decoder, encode, toString) + +import Iso8601 +import Json.Decode as Decode exposing (Decoder) +import Json.Encode as Encode +import Result +import Time + + +type alias DateOnly = + Time.Posix + + +decoder : Decoder DateOnly +decoder = + Decode.string + |> Decode.andThen decodeIsoString + + +encode : DateOnly -> Encode.Value +encode = + Encode.string << toString + + +decodeIsoString : String -> Decoder DateOnly +decodeIsoString str = + case Iso8601.toTime (str ++ "T00:00:00.000Z") of + Result.Ok posix -> + Decode.succeed posix + + Result.Err _ -> + Decode.fail <| "Invalid date: " ++ str + + +toString : DateOnly -> String +toString = + String.left 10 << Iso8601.fromTime diff --git a/samples/openapi3/client/composition/elm/src/DateTime.elm b/samples/openapi3/client/composition/elm/src/DateTime.elm new file mode 100644 index 00000000000..80b62fb7dec --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/DateTime.elm @@ -0,0 +1,37 @@ +module DateTime exposing (DateTime, decoder, encode, toString) + +import Iso8601 +import Json.Decode as Decode exposing (Decoder) +import Json.Encode as Encode +import Result +import Time + + +type alias DateTime = + Time.Posix + + +decoder : Decoder DateTime +decoder = + Decode.string + |> Decode.andThen decodeIsoString + + +encode : DateTime -> Encode.Value +encode = + Encode.string << toString + + +decodeIsoString : String -> Decoder DateTime +decodeIsoString str = + case Iso8601.toTime str of + Result.Ok posix -> + Decode.succeed posix + + Result.Err _ -> + Decode.fail <| "Invalid date: " ++ str + + +toString : DateTime -> String +toString = + Iso8601.fromTime diff --git a/samples/openapi3/client/composition/elm/src/Main.elm b/samples/openapi3/client/composition/elm/src/Main.elm new file mode 100644 index 00000000000..7c9ddd056d3 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Main.elm @@ -0,0 +1,61 @@ +module Main exposing (main) + +import Browser +import Html exposing (Html) + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- MODEL + + +type alias Model = + { value : Int + } + + +init : () -> ( Model, Cmd Msg ) +init _ = + ( Model 0, Cmd.none ) + + + +-- UPDATE + + +type Msg + = NoOp + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + NoOp -> + ( model, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions _ = + Sub.none + + + +-- VIEW + + +view : Model -> Html Msg +view _ = + Html.text "main" diff --git a/samples/openapi3/client/composition/elm/src/Request/Default.elm b/samples/openapi3/client/composition/elm/src/Request/Default.elm new file mode 100644 index 00000000000..c4a56ffd524 --- /dev/null +++ b/samples/openapi3/client/composition/elm/src/Request/Default.elm @@ -0,0 +1,123 @@ +{- + Composition and Inheritence (Polymorphism) + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + + NOTE: This file is auto generated by the openapi-generator. + https://github.com/openapitools/openapi-generator.git + Do not edit this file manually. +-} + + +module Request.Default exposing (allOfPost, allOfWithDiscriminatorPost, oneOfPost, oneOfWithAllOfDiscriminatorPost, oneOfWithDiscriminatorPost) + +import Data.AllOf as AllOf exposing (AllOf) +import Data.BaseObject as BaseObject exposing (BaseObject) +import Data.OneOf as OneOf exposing (OneOf) +import Data.OneOfWithAllOfDiscriminator as OneOfWithAllOfDiscriminator exposing (OneOfWithAllOfDiscriminator) +import Data.OneOfWithDiscriminator as OneOfWithDiscriminator exposing (OneOfWithDiscriminator) +import Dict +import Http +import Json.Decode as Decode +import Url.Builder as Url + + +basePath : String +basePath = + "http://localhost" + + +allOfPost : + { onSend : Result Http.Error AllOf -> msg + } + -> Cmd msg +allOfPost params = + Http.request + { method = "POST" + , headers = List.filterMap identity [] + , url = + Url.crossOrigin basePath + [ "allOf" ] + (List.filterMap identity []) + , body = Http.emptyBody + , expect = Http.expectJson params.onSend AllOf.decoder + , timeout = Just 30000 + , tracker = Nothing + } + + +allOfWithDiscriminatorPost : + { onSend : Result Http.Error BaseObject -> msg + } + -> Cmd msg +allOfWithDiscriminatorPost params = + Http.request + { method = "POST" + , headers = List.filterMap identity [] + , url = + Url.crossOrigin basePath + [ "allOfWithDiscriminator" ] + (List.filterMap identity []) + , body = Http.emptyBody + , expect = Http.expectJson params.onSend BaseObject.decoder + , timeout = Just 30000 + , tracker = Nothing + } + + +oneOfPost : + { onSend : Result Http.Error OneOf -> msg + } + -> Cmd msg +oneOfPost params = + Http.request + { method = "POST" + , headers = List.filterMap identity [] + , url = + Url.crossOrigin basePath + [ "oneOf" ] + (List.filterMap identity []) + , body = Http.emptyBody + , expect = Http.expectJson params.onSend OneOf.decoder + , timeout = Just 30000 + , tracker = Nothing + } + + +oneOfWithAllOfDiscriminatorPost : + { onSend : Result Http.Error OneOfWithAllOfDiscriminator -> msg + } + -> Cmd msg +oneOfWithAllOfDiscriminatorPost params = + Http.request + { method = "POST" + , headers = List.filterMap identity [] + , url = + Url.crossOrigin basePath + [ "oneOfWithAllOfDiscriminator" ] + (List.filterMap identity []) + , body = Http.emptyBody + , expect = Http.expectJson params.onSend OneOfWithAllOfDiscriminator.decoder + , timeout = Just 30000 + , tracker = Nothing + } + + +oneOfWithDiscriminatorPost : + { onSend : Result Http.Error OneOfWithDiscriminator -> msg + } + -> Cmd msg +oneOfWithDiscriminatorPost params = + Http.request + { method = "POST" + , headers = List.filterMap identity [] + , url = + Url.crossOrigin basePath + [ "oneOfWithDiscriminator" ] + (List.filterMap identity []) + , body = Http.emptyBody + , expect = Http.expectJson params.onSend OneOfWithDiscriminator.decoder + , timeout = Just 30000 + , tracker = Nothing + } diff --git a/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION b/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION index 479c313e87b..d168f1d8bda 100644 --- a/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/elm/src/Data/ApiResponse.elm b/samples/openapi3/client/petstore/elm/src/Data/ApiResponse.elm index 3559c4f3fe8..7fbf5de80e7 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/ApiResponse.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/ApiResponse.elm @@ -10,7 +10,7 @@ -} -module Data.ApiResponse exposing (ApiResponse, decoder, encode) +module Data.ApiResponse exposing (ApiResponse, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -37,12 +37,28 @@ decoder = encode : ApiResponse -> Encode.Value -encode model = - Encode.object - [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) - , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) - , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) - - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> ApiResponse -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : ApiResponse -> List (String, Encode.Value) +encodePairs model = + [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) + , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) + , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) + ] + + + +toString : ApiResponse -> String +toString = + Encode.encode 0 << encode + + diff --git a/samples/openapi3/client/petstore/elm/src/Data/Category.elm b/samples/openapi3/client/petstore/elm/src/Data/Category.elm index 9a5803626d9..d0b29b295da 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/Category.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/Category.elm @@ -10,7 +10,7 @@ -} -module Data.Category exposing (Category, decoder, encode) +module Data.Category exposing (Category, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -35,11 +35,27 @@ decoder = encode : Category -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) - - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Category -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Category -> List (String, Encode.Value) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) + ] + + + +toString : Category -> String +toString = + Encode.encode 0 << encode + + diff --git a/samples/openapi3/client/petstore/elm/src/Data/InlineObject.elm b/samples/openapi3/client/petstore/elm/src/Data/InlineObject.elm index 0fda842c6c7..cac10db9769 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/InlineObject.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/InlineObject.elm @@ -10,7 +10,7 @@ -} -module Data.InlineObject exposing (InlineObject, decoder, encode) +module Data.InlineObject exposing (InlineObject, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -33,11 +33,27 @@ decoder = encode : InlineObject -> Encode.Value -encode model = - Encode.object - [ ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) - , ( "status", Maybe.withDefault Encode.null (Maybe.map Encode.string model.status) ) - - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> InlineObject -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : InlineObject -> List (String, Encode.Value) +encodePairs model = + [ ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) + , ( "status", Maybe.withDefault Encode.null (Maybe.map Encode.string model.status) ) + ] + + + +toString : InlineObject -> String +toString = + Encode.encode 0 << encode + + diff --git a/samples/openapi3/client/petstore/elm/src/Data/InlineObject1.elm b/samples/openapi3/client/petstore/elm/src/Data/InlineObject1.elm index 8ec67406c35..ac64e3132f3 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/InlineObject1.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/InlineObject1.elm @@ -10,7 +10,7 @@ -} -module Data.InlineObject1 exposing (InlineObject1, decoder, encode) +module Data.InlineObject1 exposing (InlineObject1, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -33,11 +33,27 @@ decoder = encode : InlineObject1 -> Encode.Value -encode model = - Encode.object - [ ( "additionalMetadata", Maybe.withDefault Encode.null (Maybe.map Encode.string model.additionalMetadata) ) - , ( "file", Maybe.withDefault Encode.null (Maybe.map Encode.string model.file) ) - - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> InlineObject1 -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : InlineObject1 -> List (String, Encode.Value) +encodePairs model = + [ ( "additionalMetadata", Maybe.withDefault Encode.null (Maybe.map Encode.string model.additionalMetadata) ) + , ( "file", Maybe.withDefault Encode.null (Maybe.map Encode.string model.file) ) + ] + + + +toString : InlineObject1 -> String +toString = + Encode.encode 0 << encode + + diff --git a/samples/openapi3/client/petstore/elm/src/Data/Order_.elm b/samples/openapi3/client/petstore/elm/src/Data/Order_.elm index f1a620a19f1..7a7325592ad 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/Order_.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/Order_.elm @@ -10,7 +10,7 @@ -} -module Data.Order_ exposing (Order_, Status(..), decoder, encode) +module Data.Order_ exposing (Order_, Status(..), decoder, encode, encodeWithTag, toString) import DateTime exposing (DateTime) import Dict exposing (Dict) @@ -51,16 +51,31 @@ decoder = encode : Order_ -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) - , ( "quantity", Maybe.withDefault Encode.null (Maybe.map Encode.int model.quantity) ) - , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) - , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) - , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Order_ -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Order_ -> List (String, Encode.Value) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) + , ( "quantity", Maybe.withDefault Encode.null (Maybe.map Encode.int model.quantity) ) + , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) + , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) + , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) + ] + + + +toString : Order_ -> String +toString = + Encode.encode 0 << encode - ] @@ -99,3 +114,4 @@ encodeStatus model = + diff --git a/samples/openapi3/client/petstore/elm/src/Data/Pet.elm b/samples/openapi3/client/petstore/elm/src/Data/Pet.elm index 4eaf5a47938..3267cfc059e 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/Pet.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/Pet.elm @@ -10,7 +10,7 @@ -} -module Data.Pet exposing (Pet, Status(..), decoder, encode) +module Data.Pet exposing (Pet, Status(..), decoder, encode, encodeWithTag, toString) import Data.Category as Category exposing (Category) import Data.Tag as Tag exposing (Tag) @@ -52,16 +52,31 @@ decoder = encode : Pet -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) - , ( "name", Encode.string model.name ) - , ( "photoUrls", (Encode.list Encode.string) model.photoUrls ) - , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) ) - , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Pet -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Pet -> List (String, Encode.Value) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) + , ( "name", Encode.string model.name ) + , ( "photoUrls", (Encode.list Encode.string) model.photoUrls ) + , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) ) + , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) + ] + + + +toString : Pet -> String +toString = + Encode.encode 0 << encode - ] @@ -100,3 +115,4 @@ encodeStatus model = + diff --git a/samples/openapi3/client/petstore/elm/src/Data/Tag.elm b/samples/openapi3/client/petstore/elm/src/Data/Tag.elm index 16118b9b80b..2fbd439fe97 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/Tag.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/Tag.elm @@ -10,7 +10,7 @@ -} -module Data.Tag exposing (Tag, decoder, encode) +module Data.Tag exposing (Tag, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -35,11 +35,27 @@ decoder = encode : Tag -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) - - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> Tag -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : Tag -> List (String, Encode.Value) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) + ] + + + +toString : Tag -> String +toString = + Encode.encode 0 << encode + + diff --git a/samples/openapi3/client/petstore/elm/src/Data/User.elm b/samples/openapi3/client/petstore/elm/src/Data/User.elm index 0b0cba12cc4..819857888dc 100644 --- a/samples/openapi3/client/petstore/elm/src/Data/User.elm +++ b/samples/openapi3/client/petstore/elm/src/Data/User.elm @@ -10,7 +10,7 @@ -} -module Data.User exposing (User, decoder, encode) +module Data.User exposing (User, decoder, encode, encodeWithTag, toString) import Dict exposing (Dict) import Json.Decode as Decode exposing (Decoder) @@ -47,17 +47,33 @@ decoder = encode : User -> Encode.Value -encode model = - Encode.object - [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) - , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) - , ( "firstName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.firstName) ) - , ( "lastName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.lastName) ) - , ( "email", Maybe.withDefault Encode.null (Maybe.map Encode.string model.email) ) - , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) - , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) - , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) - - ] +encode = + Encode.object << encodePairs + + +encodeWithTag : ( String, String ) -> User -> Encode.Value +encodeWithTag (tagField, tag) model = + Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] + + +encodePairs : User -> List (String, Encode.Value) +encodePairs model = + [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) + , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) + , ( "firstName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.firstName) ) + , ( "lastName", Maybe.withDefault Encode.null (Maybe.map Encode.string model.lastName) ) + , ( "email", Maybe.withDefault Encode.null (Maybe.map Encode.string model.email) ) + , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) + , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) + , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) + ] + + + +toString : User -> String +toString = + Encode.encode 0 << encode + + diff --git a/samples/openapi3/client/petstore/elm/src/Request/Pet.elm b/samples/openapi3/client/petstore/elm/src/Request/Pet.elm index af5b1654eca..a7a77529477 100644 --- a/samples/openapi3/client/petstore/elm/src/Request/Pet.elm +++ b/samples/openapi3/client/petstore/elm/src/Request/Pet.elm @@ -25,8 +25,8 @@ type Status | StatusPending | StatusSold -statusToString : Status -> String -statusToString value = +stringifyStatus : Status -> String +stringifyStatus value = case value of StatusAvailable -> "available" @@ -58,10 +58,10 @@ addPet : addPet params = Http.request { method = "POST" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["pet"] - [] + (List.filterMap identity []) , body = Http.jsonBody <| Pet.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -83,10 +83,10 @@ deletePet : deletePet headers params = Http.request { method = "DELETE" - , headers = List.filterMap identity [Maybe.map (Http.header "api_key" ) headers.apiKey] + , headers = List.filterMap identity [Maybe.map (Http.header "api_key" << identity) headers.apiKey] , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId] - [] + ["pet", String.fromInt params.petId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -108,10 +108,10 @@ findPetsByStatus : findPetsByStatus params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["pet", "findByStatus"] - (List.filterMap identity [Just (Url.string "status" <| (String.join "," << List.map statusToString) params.status)]) + (List.filterMap identity [(Just << Url.string "status" << String.join "," << List.map stringifyStatus) params.status]) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , timeout = Just 30000 @@ -127,16 +127,16 @@ findPetsByTags : - , tags : List String , maxCount : Maybe (Int) + , tags : List String } -> Cmd msg findPetsByTags params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["pet", "findByTags"] - (List.filterMap identity [Just (Url.string "tags" <| (String.join ",") params.tags), Maybe.map (Url.string "maxCount" << String.fromInt) params.maxCount]) + (List.filterMap identity [(Just << Url.string "tags" << String.join "," << List.map identity) params.tags]) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , timeout = Just 30000 @@ -158,10 +158,10 @@ getPetById : getPetById params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId] - [] + ["pet", String.fromInt params.petId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend Pet.decoder , timeout = Just 30000 @@ -181,10 +181,10 @@ updatePet : updatePet params = Http.request { method = "PUT" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["pet"] - [] + (List.filterMap identity []) , body = Http.jsonBody <| Pet.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -204,10 +204,10 @@ updatePetWithForm : updatePetWithForm params = Http.request { method = "POST" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId] - [] + ["pet", String.fromInt params.petId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -227,10 +227,10 @@ uploadFile : uploadFile params = Http.request { method = "POST" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId, "uploadImage"] - [] + ["pet", String.fromInt params.petId, "uploadImage"] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend ApiResponse.decoder , timeout = Just 30000 diff --git a/samples/openapi3/client/petstore/elm/src/Request/Store.elm b/samples/openapi3/client/petstore/elm/src/Request/Store.elm index 7ac926fe41e..e2a40d41938 100644 --- a/samples/openapi3/client/petstore/elm/src/Request/Store.elm +++ b/samples/openapi3/client/petstore/elm/src/Request/Store.elm @@ -40,10 +40,10 @@ deleteOrder : deleteOrder params = Http.request { method = "DELETE" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["store", "order", params.orderId] - [] + ["store", "order", identity params.orderId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -65,10 +65,10 @@ getInventory : getInventory params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["store", "inventory"] - [] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.dict Decode.int) , timeout = Just 30000 @@ -90,10 +90,10 @@ getOrderById : getOrderById params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["store", "order", String.fromInt params.orderId] - [] + ["store", "order", String.fromInt params.orderId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend Order_.decoder , timeout = Just 30000 @@ -113,10 +113,10 @@ placeOrder : placeOrder params = Http.request { method = "POST" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["store", "order"] - [] + (List.filterMap identity []) , body = Http.jsonBody <| Order_.encode params.body , expect = Http.expectJson params.onSend Order_.decoder , timeout = Just 30000 diff --git a/samples/openapi3/client/petstore/elm/src/Request/User.elm b/samples/openapi3/client/petstore/elm/src/Request/User.elm index 6d6d21918a6..0bb8411573b 100644 --- a/samples/openapi3/client/petstore/elm/src/Request/User.elm +++ b/samples/openapi3/client/petstore/elm/src/Request/User.elm @@ -40,10 +40,10 @@ createUser : createUser params = Http.request { method = "POST" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["user"] - [] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -63,10 +63,10 @@ createUsersWithArrayInput : createUsersWithArrayInput params = Http.request { method = "POST" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["user", "createWithArray"] - [] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -86,10 +86,10 @@ createUsersWithListInput : createUsersWithListInput params = Http.request { method = "POST" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["user", "createWithList"] - [] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -111,10 +111,10 @@ deleteUser : deleteUser params = Http.request { method = "DELETE" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["user", params.username] - [] + ["user", identity params.username] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -134,10 +134,10 @@ getUserByName : getUserByName params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["user", params.username] - [] + ["user", identity params.username] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend User.decoder , timeout = Just 30000 @@ -157,10 +157,10 @@ loginUser : loginUser params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["user", "login"] - (List.filterMap identity [Just (Url.string "username" params.username), Just (Url.string "password" params.password)]) + (List.filterMap identity [(Just << Url.string "username" << identity) params.username, (Just << Url.string "password" << identity) params.password]) , body = Http.emptyBody , expect = Http.expectJson params.onSend Decode.string , timeout = Just 30000 @@ -180,10 +180,10 @@ logoutUser : logoutUser params = Http.request { method = "GET" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath ["user", "logout"] - [] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -205,10 +205,10 @@ updateUser : updateUser params = Http.request { method = "PUT" - , headers = [] + , headers = List.filterMap identity [] , url = Url.crossOrigin basePath - ["user", params.username] - [] + ["user", identity params.username] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 89234f99db5..12f9a678845 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 7e5aef30bcb..ebeedda1221 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 3928e943fe2..f7c7fa21b0a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 337af48cc0b..766e3232e11 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 9229fefbb5c..0aa9882f561 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 48496d82dbd..f687e694634 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index edaa1d2b8b5..78b7fda2f63 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 83dd6134b73..8e14af2f5fd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index f7efbb034a9..1296a358947 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 31036ed2c24..649899abc0a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 6b468e96048..0c6891b4f64 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index db94841581b..b59f68fd3c3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 9b72d9ffe51..e8ff5c058f6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 11244ecfb20..9d31d3cb6cf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 32c44dd7df8..2ab6e831489 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 011f4a5e87f..aa2188451a1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index fee455fefb7..15aea154e89 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index ea464ecb3d4..6a5e6d4c417 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index af85243996e..44446bc5e1b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 73864723cc1..709bfb60385 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 0fc47ff2546..69be17a86bf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index a4584628076..eaafe43ceb0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index de27e21800e..fcfa69fa6d9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 90d3768d64b..b024829f263 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index a18c5b38c08..9e7be64a8ab 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 4821949ea07..0546491c4bc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index bdae38871ac..1416a9826c8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index d6601083280..e88decfd1e4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 27324041b2b..584633e3029 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index d803f9439bc..558a7044ba3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 9db27c7c93c..5e766086b58 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 5d0fac0c830..253755fc056 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 2fa4357088f..93c6b6ef311 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php index f79533a0b85..36d5529388b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php index b400495b3fa..3aeece7a8c4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php index 291d81be469..41f190e45a1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php index 276e87343c0..600ed682d3a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php index 9fe85483eaf..94261fbc9fb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php index 5fbeccae01a..e9c017b26d4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index c574882dbf1..3761d231ee6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 77e3656df58..94b7f7abfc9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 7e05ebd4901..8dacfce0348 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 4627a69ab52..fa1b81a986b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 79bcab1ca93..90427e76d18 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 8bfec03077d..642ae73593a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 5661524ff9d..f0173a5f6cf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 490c7609775..e3be40ba9a0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index 090264d5ebf..530bedc8960 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 17f4844d3b4..3beb50bc5e1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 2fc6eaa6c8a..babd96f5204 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index fc26df1dd1b..ebd0445b2f1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 84e8aa75203..6baa08af61d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index faba95dda01..7ece753a729 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index 54311eb6ec4..fd2ee3c8193 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index b5612a53c46..13f0842f116 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index c3cde4e2da0..d354c76f413 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 32db4a51955..8bae1a41f53 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index cb041a5157f..b7943456344 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index b04e3a085d6..60e444027ce 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 781971035b6..af838827448 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index fc8db7b3164..9f114e8c23a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,11 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index f7ebb34cc98..085e0ec51a7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php index f747862fb42..90ff6b8ba51 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php @@ -17,7 +17,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index cf227d1c7b3..d50362da630 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index 25ee8db1019..d32ffffe304 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index 49a00a98ae0..c6196c94847 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index 9e1ca342942..b6c572675c3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 036f9d0fce7..dac36452fa3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index 67641db313c..d4300d7c1a6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index 22b4da20273..11de6517ba1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index 769fb143806..50546d9e41c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 3888a2acbca..7f17f00feda 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 01739a814f1..a50599af4ae 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 091dbcd8411..dc4254c97a1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index 48852ba5569..3f34937a46c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php index 93093478e70..06aff23ed36 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 53f1a0aa495..76341ffb67b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index ae8a8b25643..53a32989d00 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index cc76f2903b3..e75890dc8dd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index 2cf80044760..b08306cfd39 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php index 0f6f81ae75a..25f085cc9fb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index 95946267855..75fbdc86bf3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 970a127d253..b8440869f02 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index 79b5918d80a..c869ee70647 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 65016c28606..39dd1c46159 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 3cc7df9e6e3..f75a6631236 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index 86b34f5ccad..c0547a7d17b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php index 412b3004794..b9d8fbb0f10 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index f4a2370d554..7bc9a2aec25 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 68a4b0dc43a..a01b7a7b447 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php index b83b3727182..a0e96d59515 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php index d5cd1a127c5..51c18fbb926 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php index 7d83b70298c..42cd05c3e8e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php index 663fc6976be..265ab6e30fa 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php index 3279f098efe..667554a3b34 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php index 6e0bfadae7a..23e9c0f5635 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php index 6bad7ab2e1b..845e3987097 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php index f4de899411b..9eaebc76666 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 42ddddff86c..c8e80f55af1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index d9c8a9bb5a2..d385a14cbbb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index 5fcb6299065..279ed3201ae 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index f6fd81b3ca1..47dfdc0c49a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index 4c9c784f628..0e10a5ca647 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 02232a6d164..3544a856298 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php index 71013973819..c8427da0a7a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index d89a2460ced..fd9d4944693 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index aefed931c95..62b2c9ef276 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 3d409221454..680b775a697 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php index 08cdb11cfb9..f160df3cda0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php index 4594e35f956..04e85dfa3dd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php index e1ad10bf286..f2c38378506 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index ac3865d7311..e59f785f939 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index 975ea9134d5..202083da76d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index a3d27b5bd41..226585b6429 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index 2b42e29c51a..f8a03ef92e9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index f375ba8096d..ccad0a178b4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 9672d99f1e7..df5dcbdd55b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,15 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech +<<<<<<< HEAD * OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD + * OpenAPI Generator version: 4.3.0-SNAPSHOT +======= + * OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x */ /** diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 5e7a95a35f3..46e568df26a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -622,11 +622,11 @@ class ApiClient(object): return data kwargs = {} - if klass.openapi_types is not None: + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): + if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index d03bd91e197..91109c7d78c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -12,7 +12,6 @@ from __future__ import absolute_import -import copy import logging import multiprocessing import sys @@ -22,21 +21,7 @@ import six from six.moves import http_client as httplib -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls, **kwargs): - if cls._default is None: - cls._default = type.__call__(cls, **kwargs) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -50,7 +35,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """ def __init__(self, host="http://petstore.swagger.io:80/v2", - api_key={}, api_key_prefix={}, + api_key=None, api_key_prefix=None, username="", password=""): """Constructor """ @@ -61,10 +46,14 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): """Temp file folder for downloading files """ # Authentication Settings - self.api_key = api_key + self.api_key = {} + if api_key: + self.api_key = api_key """dict to store API key(s) """ - self.api_key_prefix = api_key_prefix + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb index 7f8ae56e123..852b21052a7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index dfa6972327d..f41247c16a1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index eb43bc54bec..e64807e44c1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index c2b8c01eb3b..123306b17c2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 1e44496d5f8..6fdb0c7d595 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 849945bcd6e..904537581d3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index dafc7a71696..c8a06f09443 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 8e2dd2a11a2..73c52a20637 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb index d4f4e7c7e39..13d372ffcbd 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 337c5c7002c..a7913fc0eac 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 936405f68a3..4d4d674c1a1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 44722fe2893..0c3a88cfbb3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -182,7 +192,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index f12f35a3fb9..b37131fafff 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +200,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 45322966bc5..17ed8749bf8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index cabaf4e8cad..abe18d148f9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index a285dd3e898..327dfd46785 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index cb66978d710..c1a31f16f62 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +203,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index ae6779e93d1..399c8bdd44c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -51,6 +55,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +225,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 8bc81970c33..cc5c575d064 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 1f825aad892..3fbd9b9d124 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 841876180d7..1d5afc07c6b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +195,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 8fe3f0f3d6e..15a04a17c37 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 52f71511b6e..bcffca51c01 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index a94a6581d0f..faaf2b31576 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 8bedfe83840..4b62f47a316 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 6499e6c9384..571a34c7bf4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -56,6 +60,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +224,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 69fcebec615..05f483dc231 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index ed483f018d6..0777df22f91 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -80,6 +84,13 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'outer_enum', + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -307,7 +318,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 62814e28236..a3db6ff30a4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -32,6 +36,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 0cfd2a0bafe..e3973cec448 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 4b06f1f9cdd..6953b6c6ed2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index c49f4859938..fb7143e1265 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -88,6 +92,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -520,7 +530,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index f5bd2b3e5a9..265ee1ff62e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index 19b36fa6aae..b140aa8cca9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,13 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'nullable_message' + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb index d66880567b8..11bf2dad349 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb index b57dff7de30..928abba2e48 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb index 2d915a71d8d..044091e2e10 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -58,6 +62,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -218,7 +228,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb index 570c8c7c15f..d5470d04403 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -96,6 +100,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -501,7 +511,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb index fe19da767c9..deafcb6f506 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -190,7 +200,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb index f3b82be235e..a12b736d370 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +195,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index c74cd7476c0..031dbaf7784 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 2de84143b82..da3d106562c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 262374d278a..8297b2d2f87 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -64,6 +68,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +236,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 0fca26bc281..efd27371fc8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +199,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 7633a6473a1..76f11306d03 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -35,6 +39,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +189,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 96803b3cfca..9af9e5faa42 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb index cc7b5f5f720..b451763c1f8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -43,6 +47,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +212,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index 4b5991bef5c..da9df9f8f28 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -74,6 +78,22 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'integer_prop', + :'number_prop', + :'boolean_prop', + :'string_prop', + :'date_prop', + :'datetime_prop', + :'array_nullable_prop', + :'array_and_items_nullable_prop', + :'object_nullable_prop', + :'object_and_items_nullable_prop', + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -280,7 +300,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index e22793a2ca1..ba25075f199 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb index 30082ec0207..182a75d3b39 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +261,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index e5a4dbbf7ff..f682dda3ef7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index d7c1b931b97..75f90f6ef0d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index dae97c9a7f5..13da1fd753b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index 58c8c974130..2231bdacf55 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index 8ffe7f388d2..ed594f90b39 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index aded7da65e0..56562092d66 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +273,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index bac38b69abc..75e13ee53da 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 12fec5a6901..98f72128730 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 7e89b7db239..30c3c0d1474 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb index ea5a393bead..bb73fcccac1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -59,6 +63,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +243,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb index fba2068c04d..639fff79857 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec index 9ec5502dc6a..8a35f17b52c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb index bf187f0971f..ba85c6e3f3c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb index fd58eaa21a6..849eb7fc84f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index 083a1c6ab70..fd2248d226c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb index 1db2b3c9ef5..709f74be6ec 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb index 26ca32b2f75..fae3e57680b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb index 1fd9faf40aa..e8bf668c36b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb index 39178c5a5ac..3f18d5f8916 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb index 70e29586d38..e8f46f6cc5f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb index 0bea24033c6..be549c30bc4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb index 93a5b0d5fb4..c6a0b48b485 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb index 8b3e9adc537..886387d824c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb index 628f1c4d7c1..7bb27bc462f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb index ea41c9a4b38..9fd8b1dcf17 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb index ba90932a797..7a7ce9edcff 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb index 6ff7397ad43..c9309afc0b8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb index 451c59af970..029ad6883af 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb index 926ce8a2a37..2d12de79ff1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb index 3efb677ce64..2a2d12469ff 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb index 82ecd78d966..76cd7315703 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb index 761e8933127..2d4b19e484c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb index 4bf1ce0622b..c7d3f30c794 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb index 5596927d423..c5a90f6018d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb index b82df3e9d72..2905492a554 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb index ac75c92581d..469000b386c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb index 29fcd05aa75..97a4dde432d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb index 7f4c9c97e87..f941b279847 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb index 8a8d92658c9..bcc36bfe20a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb index b9d1499766e..adbc136d4f1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb index 46f8aa8a1d9..12c728a81ef 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb index 72fe239f298..5f86929ddac 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb index 9efa03a22fe..be2313b3cc3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb index e90a77ec8a7..cc56759d60c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb index a702fd774ea..2fa693e50c1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb index 7013915ea39..81c4e66d682 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb index 4daf41b4ace..e48705131e4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb index fa806f95860..3048ccc09c1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb index e2410b21bc0..65c507c9047 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb index c5a7db44780..56ebea5683c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb index 812470131b9..f28d0d9d341 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb index db397aa108f..6e5c2ba353a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb index f7ff6788b09..1cb78a21bfc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb index 0e88f472524..0a6dbed9975 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb index 133f6b94c14..47782594793 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb index 57d400eb116..7b28f5bcf04 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb index c882db4f221..aedde807f31 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb index f1301d0a83d..caf5923232f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb index 0963591fcc1..0a06e9682ee 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb index 3f1d973b275..fa3243537c0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb index bb36f488959..80b636a0e54 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb index 7bd96a7abaf..7a2bf72d783 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb index 48a94827e56..9d6135e0fbd 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb index a0ac4c81f07..1b7a86373c1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb index ea9762da93b..bd722d47f46 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb index dc0a0898c9f..c2c85b82c27 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb index 8d60e443313..4ab95118e9f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb index b548f7f0951..8ca6493d9c8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb index 3a745439040..f0eab291f5a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb index 2eb31e993a0..58cc20d1215 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb index 64dcf6b8f47..b61ebfca154 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore.rb b/samples/openapi3/client/petstore/ruby/lib/petstore.rb index 7f8ae56e123..852b21052a7 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index dfa6972327d..f41247c16a1 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb index eb43bc54bec..e64807e44c1 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb index c2b8c01eb3b..123306b17c2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 1e44496d5f8..6fdb0c7d595 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb index 4858424f2a0..bb46b57f4ab 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb index dc4952419a1..2d6fedb7d01 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb index b2fbf6be7c6..d9ce816d166 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb index a9d41cb9af9..3be93ca19ff 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb index 337c5c7002c..a7913fc0eac 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb index 938c3b1c062..2cf62e86ddc 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 44722fe2893..0c3a88cfbb3 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -182,7 +192,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb index f12f35a3fb9..b37131fafff 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +200,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb index 45322966bc5..17ed8749bf8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index cabaf4e8cad..abe18d148f9 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index a285dd3e898..327dfd46785 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb index cb66978d710..c1a31f16f62 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +203,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb index ae6779e93d1..399c8bdd44c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -51,6 +55,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +225,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb index 8bc81970c33..cc5c575d064 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 1f825aad892..3fbd9b9d124 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb index 841876180d7..1d5afc07c6b 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +195,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb index 8fe3f0f3d6e..15a04a17c37 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb index 52f71511b6e..bcffca51c01 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb index a94a6581d0f..faaf2b31576 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +191,11 @@ module Petstore hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 8bedfe83840..4b62f47a316 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 6499e6c9384..571a34c7bf4 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -56,6 +60,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +224,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb index 69fcebec615..05f483dc231 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb index ed483f018d6..0777df22f91 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -80,6 +84,13 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'outer_enum', + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -307,7 +318,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb index 62814e28236..a3db6ff30a4 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -32,6 +36,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 0cfd2a0bafe..e3973cec448 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb index 4b06f1f9cdd..6953b6c6ed2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb index c49f4859938..fb7143e1265 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -88,6 +92,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -520,7 +530,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index f5bd2b3e5a9..265ee1ff62e 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb index 19b36fa6aae..b140aa8cca9 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,13 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'nullable_message' + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +181,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb index d66880567b8..11bf2dad349 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb index b57dff7de30..928abba2e48 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +190,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb index 2d915a71d8d..044091e2e10 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -58,6 +62,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -218,7 +228,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb index 570c8c7c15f..d5470d04403 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -96,6 +100,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -501,7 +511,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb index fe19da767c9..deafcb6f506 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -190,7 +200,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb index f3b82be235e..a12b736d370 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -36,6 +40,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +195,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index c74cd7476c0..031dbaf7784 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb index 2de84143b82..da3d106562c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb index 262374d278a..8297b2d2f87 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -64,6 +68,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +236,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 0fca26bc281..efd27371fc8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +199,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb index 7633a6473a1..76f11306d03 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -35,6 +39,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +189,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb index 96803b3cfca..9af9e5faa42 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -31,6 +35,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +180,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb index cc7b5f5f720..b451763c1f8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -43,6 +47,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +212,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb index 4b5991bef5c..da9df9f8f28 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -74,6 +78,22 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'integer_prop', + :'number_prop', + :'boolean_prop', + :'string_prop', + :'date_prop', + :'datetime_prop', + :'array_nullable_prop', + :'array_and_items_nullable_prop', + :'object_nullable_prop', + :'object_and_items_nullable_prop', + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -280,7 +300,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb index e22793a2ca1..ba25075f199 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb index 30082ec0207..182a75d3b39 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +261,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb index e5a4dbbf7ff..f682dda3ef7 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -38,6 +42,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +197,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb index d7c1b931b97..75f90f6ef0d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index dae97c9a7f5..13da1fd753b 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index 58c8c974130..2231bdacf55 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index 8ffe7f388d2..ed594f90b39 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb index aded7da65e0..56562092d66 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -73,6 +77,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +273,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb index bac38b69abc..75e13ee53da 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 12fec5a6901..98f72128730 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -30,6 +34,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +179,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb index 7e89b7db239..30c3c0d1474 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -34,6 +38,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +188,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb index ea5a393bead..bb73fcccac1 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end @@ -59,6 +63,12 @@ module Petstore } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +243,11 @@ module Petstore hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb index fba2068c04d..639fff79857 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/petstore.gemspec b/samples/openapi3/client/petstore/ruby/petstore.gemspec index d563bfe8e68..5ce083777a5 100644 --- a/samples/openapi3/client/petstore/ruby/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,11 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +OpenAPI Generator version: 4.3.0-SNAPSHOT +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb index bf187f0971f..ba85c6e3f3c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb index fd58eaa21a6..849eb7fc84f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb index 083a1c6ab70..fd2248d226c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb index 1db2b3c9ef5..709f74be6ec 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb index 26ca32b2f75..fae3e57680b 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb index 1fd9faf40aa..e8bf668c36b 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb index 39178c5a5ac..3f18d5f8916 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb index 40811533188..33ede96b49b 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb index 0bea24033c6..be549c30bc4 100644 --- a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb index 93a5b0d5fb4..c6a0b48b485 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb index 8b3e9adc537..886387d824c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb index 628f1c4d7c1..7bb27bc462f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb index ea41c9a4b38..9fd8b1dcf17 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb index ba90932a797..7a7ce9edcff 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb index 6ff7397ad43..c9309afc0b8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb index 451c59af970..029ad6883af 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb index 926ce8a2a37..2d12de79ff1 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb index 3efb677ce64..2a2d12469ff 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb index 82ecd78d966..76cd7315703 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb index 761e8933127..2d4b19e484c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb index 4bf1ce0622b..c7d3f30c794 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb index 5596927d423..c5a90f6018d 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb index b82df3e9d72..2905492a554 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb index ac75c92581d..469000b386c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb index 29fcd05aa75..97a4dde432d 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb index 7f4c9c97e87..f941b279847 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb index 8a8d92658c9..bcc36bfe20a 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb index b9d1499766e..adbc136d4f1 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb index 46f8aa8a1d9..12c728a81ef 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb index 72fe239f298..5f86929ddac 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb index 9efa03a22fe..be2313b3cc3 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb index e90a77ec8a7..cc56759d60c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb index a702fd774ea..2fa693e50c1 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb index 7013915ea39..81c4e66d682 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb index 4daf41b4ace..e48705131e4 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb index fa806f95860..3048ccc09c1 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb index e2410b21bc0..65c507c9047 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb index c5a7db44780..56ebea5683c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb index 812470131b9..f28d0d9d341 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb index db397aa108f..6e5c2ba353a 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb index f7ff6788b09..1cb78a21bfc 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb index 0e88f472524..0a6dbed9975 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb index 133f6b94c14..47782594793 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb index 57d400eb116..7b28f5bcf04 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb index c882db4f221..aedde807f31 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb index f1301d0a83d..caf5923232f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb index 0963591fcc1..0a06e9682ee 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb index 3f1d973b275..fa3243537c0 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb index bb36f488959..80b636a0e54 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb index 7bd96a7abaf..7a2bf72d783 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb index 48a94827e56..9d6135e0fbd 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb index a0ac4c81f07..1b7a86373c1 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb index ea9762da93b..bd722d47f46 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb index dc0a0898c9f..c2c85b82c27 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb index 8d60e443313..4ab95118e9f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb index b548f7f0951..8ca6493d9c8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb index 3a745439040..f0eab291f5a 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb index 2eb31e993a0..58cc20d1215 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb index 64dcf6b8f47..b61ebfca154 100644 --- a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech +<<<<<<< HEAD OpenAPI Generator version: 5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +OpenAPI Generator version: 4.3.0-SNAPSHOT +======= +OpenAPI Generator version: 4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x =end diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 0e97bd19efb..e4955748d3e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 00000000000..7c275cbf30e --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,5 @@ +package org.openapitools.api + + +object ApiUtil { +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt new file mode 100644 index 00000000000..5000cc2eb5e --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -0,0 +1,150 @@ +package org.openapitools.api + +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import org.junit.jupiter.api.Test + +import kotlinx.coroutines.flow.Flow; +import kotlinx.coroutines.test.runBlockingTest +import org.springframework.http.ResponseEntity + +class PetApiTest { + + private val service: PetApiService = PetApiServiceImpl() + private val api: PetApiController = PetApiController(service) + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun addPetTest() = runBlockingTest { + val pet:Pet? = null + val response: ResponseEntity = api.addPet(pet!!) + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deletePetTest() = runBlockingTest { + val petId:kotlin.Long? = null + val apiKey:kotlin.String? = null + val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByStatusTest() = runBlockingTest { + val status:kotlin.collections.List? = null + val response: ResponseEntity> = api.findPetsByStatus(status!!) + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByTagsTest() = runBlockingTest { + val tags:kotlin.collections.List? = null + val response: ResponseEntity> = api.findPetsByTags(tags!!) + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getPetByIdTest() = runBlockingTest { + val petId:kotlin.Long? = null + val response: ResponseEntity = api.getPetById(petId!!) + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetTest() = runBlockingTest { + val pet:Pet? = null + val response: ResponseEntity = api.updatePet(pet!!) + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetWithFormTest() = runBlockingTest { + val petId:kotlin.Long? = null + val name:kotlin.String? = null + val status:kotlin.String? = null + val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun uploadFileTest() = runBlockingTest { + val petId:kotlin.Long? = null + val additionalMetadata:kotlin.String? = null + val file:org.springframework.core.io.Resource? = null + val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt new file mode 100644 index 00000000000..b084fe87b49 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -0,0 +1,79 @@ +package org.openapitools.api + +import org.openapitools.model.Order +import org.junit.jupiter.api.Test + +import kotlinx.coroutines.flow.Flow; +import kotlinx.coroutines.test.runBlockingTest +import org.springframework.http.ResponseEntity + +class StoreApiTest { + + private val service: StoreApiService = StoreApiServiceImpl() + private val api: StoreApiController = StoreApiController(service) + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteOrderTest() = runBlockingTest { + val orderId:kotlin.String? = null + val response: ResponseEntity = api.deleteOrder(orderId!!) + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getInventoryTest() = runBlockingTest { + val response: ResponseEntity> = api.getInventory() + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getOrderByIdTest() = runBlockingTest { + val orderId:kotlin.Long? = null + val response: ResponseEntity = api.getOrderById(orderId!!) + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun placeOrderTest() = runBlockingTest { + val order:Order? = null + val response: ResponseEntity = api.placeOrder(order!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt new file mode 100644 index 00000000000..03d1eb70a7c --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -0,0 +1,145 @@ +package org.openapitools.api + +import org.openapitools.model.User +import org.junit.jupiter.api.Test + +import kotlinx.coroutines.flow.Flow; +import kotlinx.coroutines.test.runBlockingTest +import org.springframework.http.ResponseEntity + +class UserApiTest { + + private val service: UserApiService = UserApiServiceImpl() + private val api: UserApiController = UserApiController(service) + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUserTest() = runBlockingTest { + val user:User? = null + val response: ResponseEntity = api.createUser(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithArrayInputTest() = runBlockingTest { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithArrayInput(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithListInputTest() = runBlockingTest { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithListInput(user!!) + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteUserTest() = runBlockingTest { + val username:kotlin.String? = null + val response: ResponseEntity = api.deleteUser(username!!) + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getUserByNameTest() = runBlockingTest { + val username:kotlin.String? = null + val response: ResponseEntity = api.getUserByName(username!!) + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun loginUserTest() = runBlockingTest { + val username:kotlin.String? = null + val password:kotlin.String? = null + val response: ResponseEntity = api.loginUser(username!!, password!!) + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun logoutUserTest() = runBlockingTest { + val response: ResponseEntity = api.logoutUser() + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updateUserTest() = runBlockingTest { + val username:kotlin.String? = null + val user:User? = null + val response: ResponseEntity = api.updateUser(username!!, user!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 0e97bd19efb..e4955748d3e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 00000000000..958a6f3ebfe --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package org.openapitools.api + +import org.springframework.web.context.request.NativeWebRequest + +import javax.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res.setCharacterEncoding("UTF-8") + res.addHeader("Content-Type", contentType) + res.getWriter().print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt new file mode 100644 index 00000000000..fbb4dec50a3 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -0,0 +1,148 @@ +package org.openapitools.api + +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +class PetApiTest { + + private val service: PetApiService = PetApiServiceImpl() + private val api: PetApiController = PetApiController(service) + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun addPetTest() { + val pet:Pet? = null + val response: ResponseEntity = api.addPet(pet!!) + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deletePetTest() { + val petId:kotlin.Long? = null + val apiKey:kotlin.String? = null + val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByStatusTest() { + val status:kotlin.collections.List? = null + val response: ResponseEntity> = api.findPetsByStatus(status!!) + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByTagsTest() { + val tags:kotlin.collections.List? = null + val response: ResponseEntity> = api.findPetsByTags(tags!!) + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getPetByIdTest() { + val petId:kotlin.Long? = null + val response: ResponseEntity = api.getPetById(petId!!) + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetTest() { + val pet:Pet? = null + val response: ResponseEntity = api.updatePet(pet!!) + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetWithFormTest() { + val petId:kotlin.Long? = null + val name:kotlin.String? = null + val status:kotlin.String? = null + val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun uploadFileTest() { + val petId:kotlin.Long? = null + val additionalMetadata:kotlin.String? = null + val file:org.springframework.core.io.Resource? = null + val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt new file mode 100644 index 00000000000..423f98d297f --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -0,0 +1,77 @@ +package org.openapitools.api + +import org.openapitools.model.Order +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +class StoreApiTest { + + private val service: StoreApiService = StoreApiServiceImpl() + private val api: StoreApiController = StoreApiController(service) + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteOrderTest() { + val orderId:kotlin.String? = null + val response: ResponseEntity = api.deleteOrder(orderId!!) + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getInventoryTest() { + val response: ResponseEntity> = api.getInventory() + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getOrderByIdTest() { + val orderId:kotlin.Long? = null + val response: ResponseEntity = api.getOrderById(orderId!!) + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun placeOrderTest() { + val order:Order? = null + val response: ResponseEntity = api.placeOrder(order!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt new file mode 100644 index 00000000000..033b9efd611 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -0,0 +1,143 @@ +package org.openapitools.api + +import org.openapitools.model.User +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +class UserApiTest { + + private val service: UserApiService = UserApiServiceImpl() + private val api: UserApiController = UserApiController(service) + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUserTest() { + val user:User? = null + val response: ResponseEntity = api.createUser(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithArrayInputTest() { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithArrayInput(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithListInputTest() { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithListInput(user!!) + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteUserTest() { + val username:kotlin.String? = null + val response: ResponseEntity = api.deleteUser(username!!) + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getUserByNameTest() { + val username:kotlin.String? = null + val response: ResponseEntity = api.getUserByName(username!!) + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun loginUserTest() { + val username:kotlin.String? = null + val password:kotlin.String? = null + val response: ResponseEntity = api.loginUser(username!!, password!!) + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun logoutUserTest() { + val response: ResponseEntity = api.logoutUser() + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updateUserTest() { + val username:kotlin.String? = null + val user:User? = null + val response: ResponseEntity = api.updateUser(username!!, user!!) + + // TODO: test validations + } + +} diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 2f81801b794..0e97bd19efb 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json index a0a4803cd07..ec994f8fca3 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,185 +39,215 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-codegen-request-body-name" : "body" - }, - "post" : { + "summary" : "Update an existing pet", "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", - "requestBody" : { - "description" : "Pet object that needs to be added to the store", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "required" : true - }, - "responses" : { - "405" : { - "description" : "Invalid input", - "content" : { } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], "x-codegen-request-body-name" : "body" } }, "/pet/findByStatus" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by status", "description" : "Multiple status values can be provided with comma separated strings", "operationId" : "findPetsByStatus", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", "default" : "available", - "enum" : [ "available", "pending", "sold" ] - } - } + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ] + } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ] } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", "parameters" : [ { - "name" : "tags", - "in" : "query", "description" : "Tags to filter by", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ] + } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ] } }, "/pet/{petId}" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", + "tags" : [ "pet" ] + }, "get" : { - "tags" : [ "pet" ], - "summary" : "Find pet by ID", "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -232,33 +259,34 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] - } ] + } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ] }, "post" : { - "tags" : [ "pet" ], - "summary" : "Updates a pet in the store with form data", "operationId" : "updatePetWithForm", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet that needs to be updated", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -267,12 +295,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -281,58 +309,28 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - }, - "delete" : { - "tags" : [ "pet" ], - "summary" : "Deletes a pet", - "operationId" : "deletePet", - "parameters" : [ { - "name" : "api_key", - "in" : "header", - "schema" : { - "type" : "string" - } - }, { - "name" : "petId", - "in" : "path", - "description" : "Pet id to delete", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" - } } ], - "responses" : { - "400" : { - "description" : "Invalid pet value", - "content" : { } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] + "summary" : "Updates a pet in the store with form data", + "tags" : [ "pet" ] } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -341,13 +339,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -356,55 +354,54 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ] + } ], + "summary" : "uploads an image", + "tags" : [ "pet" ] } }, "/store/inventory" : { "get" : { - "tags" : [ "store" ], - "summary" : "Returns pet inventories by status", "description" : "Returns a map of status codes to quantities", "operationId" : "getInventory", "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { - "type" : "object", "additionalProperties" : { - "type" : "integer", - "format" : "int32" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] - } ] + } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ] } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -412,11 +409,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -428,69 +425,27 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], "x-codegen-request-body-name" : "body" } }, "/store/order/{orderId}" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - "operationId" : "getOrderById", - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of pet that needs to be fetched", - "required" : true, - "schema" : { - "maximum" : 5, - "minimum" : 1, - "type" : "integer", - "format" : "int64" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - } - } - }, - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - } - }, "delete" : { - "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "operationId" : "deleteOrder", "parameters" : [ { - "name" : "orderId", - "in" : "path", "description" : "ID of the order that needs to be deleted", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -498,24 +453,66 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } - } + }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ] + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ] } }, "/user" : { "post" : { - "tags" : [ "user" ], - "summary" : "Create user", "description" : "This can only be done by the logged in user.", "operationId" : "createUser", "requestBody" : { - "description" : "Created user object", "content" : { "*/*" : { "schema" : { @@ -523,90 +520,91 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], "x-codegen-request-body-name" : "body" } }, "/user/createWithArray" : { "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithArrayInput", "requestBody" : { - "description" : "List of user object", "content" : { "*/*" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/User" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], "x-codegen-request-body-name" : "body" } }, "/user/createWithList" : { "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithListInput", "requestBody" : { - "description" : "List of user object", "content" : { "*/*" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/User" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], "x-codegen-request-body-name" : "body" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -614,65 +612,90 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "X-Expires-After" : { "description" : "date in UTC when toekn expires", "schema" : { - "type" : "string", - "format" : "date-time" - } - } - }, - "content" : { - "application/xml" : { - "schema" : { - "type" : "string" - } - }, - "application/json" : { - "schema" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } - } + }, + "summary" : "Logs user into the system", + "tags" : [ "user" ] } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } - } + }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ] } }, "/user/{username}" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", + "tags" : [ "user" ] + }, "get" : { - "tags" : [ "user" ], - "summary" : "Get user by user name", "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -680,7 +703,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -692,34 +714,34 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } - } + }, + "summary" : "Get user by user name", + "tags" : [ "user" ] }, "put" : { - "tags" : [ "user" ], - "summary" : "Updated user", "description" : "This can only be done by the logged in user.", "operationId" : "updateUser", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "name that need to be deleted", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -727,79 +749,28 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-codegen-request-body-name" : "body" - }, - "delete" : { + "summary" : "Updated user", "tags" : [ "user" ], - "summary" : "Delete user", - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be deleted", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied", - "content" : { } - }, - "404" : { - "description" : "User not found", - "content" : { } - } - } + "x-codegen-request-body-name" : "body" } } }, "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, "description" : "An order for a pets from the pet store", "example" : { "petId" : 6, @@ -809,38 +780,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, "description" : "A category for a pet", "example" : { "name" : "name", "id" : 6 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -861,89 +870,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "description" : "A User who is purchasing from the pet store", - "example" : { - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" - }, + "title" : "a User", + "type" : "object", "xml" : { "name" : "User" } }, "Tag" : { - "title" : "Pet Tag", - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, "description" : "A tag for a pet", "example" : { "name" : "name", "id" : 1 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "category" : { - "$ref" : "#/components/schemas/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - }, - "items" : { - "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - }, - "items" : { - "$ref" : "#/components/schemas/Tag" - } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, "description" : "A pet for sale in the pet store", "example" : { "photoUrls" : [ "photoUrls", "photoUrls" ], @@ -962,17 +921,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -981,17 +985,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1000,12 +999,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index c3a2c7076fa..d168f1d8bda 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/CMakeLists.txt b/samples/server/petstore/cpp-pistache/CMakeLists.txt index 0cd21eda298..992a04bf681 100644 --- a/samples/server/petstore/cpp-pistache/CMakeLists.txt +++ b/samples/server/petstore/cpp-pistache/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.2) project(api-server) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pg -g3" ) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pg -g3" ) include(ExternalProject) diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/server/petstore/go-api-server/go/api_pet.go b/samples/server/petstore/go-api-server/go/api_pet.go index 3f12afa82cd..f5275ecbef3 100644 --- a/samples/server/petstore/go-api-server/go/api_pet.go +++ b/samples/server/petstore/go-api-server/go/api_pet.go @@ -95,7 +95,7 @@ func (c *PetApiController) AddPet(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // DeletePet - Deletes a pet @@ -114,7 +114,7 @@ func (c *PetApiController) DeletePet(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // FindPetsByStatus - Finds Pets by status @@ -127,7 +127,7 @@ func (c *PetApiController) FindPetsByStatus(w http.ResponseWriter, r *http.Reque return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // FindPetsByTags - Finds Pets by tags @@ -140,7 +140,7 @@ func (c *PetApiController) FindPetsByTags(w http.ResponseWriter, r *http.Request return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // GetPetById - Find pet by ID @@ -158,7 +158,7 @@ func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // UpdatePet - Update an existing pet @@ -175,7 +175,7 @@ func (c *PetApiController) UpdatePet(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // UpdatePetWithForm - Updates a pet in the store with form data @@ -201,7 +201,7 @@ func (c *PetApiController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // UploadFile - uploads an image @@ -232,5 +232,5 @@ func (c *PetApiController) UploadFile(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } diff --git a/samples/server/petstore/go-api-server/go/api_store.go b/samples/server/petstore/go-api-server/go/api_store.go index c67296a2424..fc9da3c0ee5 100644 --- a/samples/server/petstore/go-api-server/go/api_store.go +++ b/samples/server/petstore/go-api-server/go/api_store.go @@ -67,7 +67,7 @@ func (c *StoreApiController) DeleteOrder(w http.ResponseWriter, r *http.Request) return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // GetInventory - Returns pet inventories by status @@ -78,7 +78,7 @@ func (c *StoreApiController) GetInventory(w http.ResponseWriter, r *http.Request return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // GetOrderById - Find purchase order by ID @@ -96,7 +96,7 @@ func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // PlaceOrder - Place an order for a pet @@ -113,5 +113,5 @@ func (c *StoreApiController) PlaceOrder(w http.ResponseWriter, r *http.Request) return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } diff --git a/samples/server/petstore/go-api-server/go/api_user.go b/samples/server/petstore/go-api-server/go/api_user.go index f883fc9f886..a6618b9d62d 100644 --- a/samples/server/petstore/go-api-server/go/api_user.go +++ b/samples/server/petstore/go-api-server/go/api_user.go @@ -95,7 +95,7 @@ func (c *UserApiController) CreateUser(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // CreateUsersWithArrayInput - Creates list of users with given input array @@ -112,7 +112,7 @@ func (c *UserApiController) CreateUsersWithArrayInput(w http.ResponseWriter, r * return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // CreateUsersWithListInput - Creates list of users with given input array @@ -129,7 +129,7 @@ func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *h return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // DeleteUser - Delete user @@ -142,7 +142,7 @@ func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // GetUserByName - Get user by user name @@ -155,7 +155,7 @@ func (c *UserApiController) GetUserByName(w http.ResponseWriter, r *http.Request return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // LoginUser - Logs user into the system @@ -169,7 +169,7 @@ func (c *UserApiController) LoginUser(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // LogoutUser - Logs out current logged in user session @@ -180,7 +180,7 @@ func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } // UpdateUser - Updated user @@ -199,5 +199,5 @@ func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request) { return } - EncodeJSONResponse(result, nil, w) + EncodeJSONResponse(result, nil, w) } diff --git a/samples/server/petstore/go-api-server/go/routers.go b/samples/server/petstore/go-api-server/go/routers.go index 5663164f6e5..bffdd7ec367 100644 --- a/samples/server/petstore/go-api-server/go/routers.go +++ b/samples/server/petstore/go-api-server/go/routers.go @@ -15,7 +15,6 @@ import ( "net/http" "os" "strconv" - "github.com/gorilla/mux" ) diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/haskell-servant/lib/OpenAPIPetstore/API.hs b/samples/server/petstore/haskell-servant/lib/OpenAPIPetstore/API.hs index a6d82d94970..a70eb607c7a 100644 --- a/samples/server/petstore/haskell-servant/lib/OpenAPIPetstore/API.hs +++ b/samples/server/petstore/haskell-servant/lib/OpenAPIPetstore/API.hs @@ -61,7 +61,7 @@ import Servant.Client (ClientEnv, Scheme (Http), C mkClientEnv, parseBaseUrl) import Servant.Client.Core (baseUrlPort, baseUrlHost) import Servant.Client.Internal.HttpClient (ClientM (..)) -import Servant.Server (Handler (..)) +import Servant.Server (Handler (..), Application) import Servant.Server.StaticFiles (serveDirectoryFileServer) import Web.FormUrlEncoded import Web.HttpApiData @@ -271,8 +271,8 @@ requestMiddlewareId a = a -- | Run the OpenAPIPetstore server at the provided host and port. runOpenAPIPetstoreServer -:: (MonadIO m, MonadThrow m) -=> Config -> OpenAPIPetstoreBackend (ExceptT ServerError IO) -> m () + :: (MonadIO m, MonadThrow m) + => Config -> OpenAPIPetstoreBackend (ExceptT ServerError IO) -> m () runOpenAPIPetstoreServer config backend = runOpenAPIPetstoreMiddlewareServer config requestMiddlewareId backend -- | Run the OpenAPIPetstore server at the provided host and port. diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION index afa63656064..e4955748d3e 100644 --- a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION +++ b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/pom.xml b/samples/server/petstore/java-pkmst/pom.xml index 8a62b880bf6..66150f46315 100644 --- a/samples/server/petstore/java-pkmst/pom.xml +++ b/samples/server/petstore/java-pkmst/pom.xml @@ -232,7 +232,7 @@ org.threeten threetenbp - 1.3.6 + 1.4.0 diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java index 5f3bc7b9115..ec1b2c40b72 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.0.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.2-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java index e4786488ec7..c3d12f4e9c1 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.0.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.2-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java index f136720e197..74634432fb4 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.0.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.2-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/model/Pet.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/model/Pet.java index 2d364ea986d..2d5e1ef4e1b 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/model/Pet.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/model/Pet.java @@ -26,7 +26,7 @@ public class Pet { private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") private String name; diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index 0c37a719c01..87e3f5aad76 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,11 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +<<<<<<< HEAD Generated by OpenAPI Generator 5.0.0-SNAPSHOT. +======= +Generated by OpenAPI Generator 4.3.0-SNAPSHOT. +>>>>>>> 4.3.x ## Requires diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 00000000000..7c275cbf30e --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,5 @@ +package org.openapitools.api + + +object ApiUtil { +} diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 00000000000..958a6f3ebfe --- /dev/null +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package org.openapitools.api + +import org.springframework.web.context.request.NativeWebRequest + +import javax.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res.setCharacterEncoding("UTF-8") + res.addHeader("Content-Type", contentType) + res.getWriter().print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index 0e97bd19efb..d168f1d8bda 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION +++ b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/php-slim/.openapi-generator/VERSION b/samples/server/petstore/php-slim/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/php-slim/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index d99e7162d01..a711b94f291 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1,9 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +<<<<<<< HEAD +4.3.0-SNAPSHOT +======= +4.2.2-SNAPSHOT +>>>>>>> origin/master +>>>>>>> 4.3.x diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION index 4395ff59232..d168f1d8bda 100644 --- a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb b/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb index 8b0bdc79ca8..dfff064d145 100644 --- a/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb +++ b/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb b/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb index 2f9652e99de..ba2a41feeaa 100644 --- a/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb +++ b/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb b/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb index 33e22a3b8da..2fe71c35b17 100644 --- a/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb +++ b/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/api_response.rb b/samples/server/petstore/ruby-on-rails/app/models/api_response.rb index 310396b1d77..0c1e6d50b9a 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/api_response.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/api_response.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/category.rb b/samples/server/petstore/ruby-on-rails/app/models/category.rb index 2063e8d9b43..49063118cae 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/category.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/category.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/inline_object.rb b/samples/server/petstore/ruby-on-rails/app/models/inline_object.rb new file mode 100644 index 00000000000..0295f078e06 --- /dev/null +++ b/samples/server/petstore/ruby-on-rails/app/models/inline_object.rb @@ -0,0 +1,14 @@ +=begin +OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +The version of the OpenAPI document: 1.0.0 +Generated by: https://github.com/openapitools/openapi-generator.git + +=end + + +class InlineObject < ApplicationRecord + +end diff --git a/samples/server/petstore/ruby-on-rails/app/models/inline_object_1.rb b/samples/server/petstore/ruby-on-rails/app/models/inline_object_1.rb new file mode 100644 index 00000000000..b8a3bcb66cd --- /dev/null +++ b/samples/server/petstore/ruby-on-rails/app/models/inline_object_1.rb @@ -0,0 +1,14 @@ +=begin +OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +The version of the OpenAPI document: 1.0.0 +Generated by: https://github.com/openapitools/openapi-generator.git + +=end + + +class InlineObject1 < ApplicationRecord + +end diff --git a/samples/server/petstore/ruby-on-rails/app/models/order.rb b/samples/server/petstore/ruby-on-rails/app/models/order.rb index 8c08266bb8b..5bf6bc33f56 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/order.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/order.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/pet.rb b/samples/server/petstore/ruby-on-rails/app/models/pet.rb index b749610040a..be067cf6eca 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/pet.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/pet.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/tag.rb b/samples/server/petstore/ruby-on-rails/app/models/tag.rb index 302ed77e334..b949dfb574b 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/tag.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/tag.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/user.rb b/samples/server/petstore/ruby-on-rails/app/models/user.rb index 8df3aa77ef3..53263747e9b 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/user.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/user.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/config/routes.rb b/samples/server/petstore/ruby-on-rails/config/routes.rb index 98a423786e5..6b591017a9e 100644 --- a/samples/server/petstore/ruby-on-rails/config/routes.rb +++ b/samples/server/petstore/ruby-on-rails/config/routes.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb index ba2dfae7f04..fbf324f2d19 100644 --- a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb +++ b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb @@ -3,7 +3,7 @@ OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end @@ -25,6 +25,20 @@ class InitTables < ActiveRecord::Migration t.timestamps end + create_table "inline_object".pluralize.to_sym, id: false do |t| + t.string :name + t.string :status + + t.timestamps + end + + create_table "inline_object_1".pluralize.to_sym, id: false do |t| + t.string :additional_metadata + t.File :file + + t.timestamps + end + create_table "order".pluralize.to_sym, id: false do |t| t.integer :id t.integer :pet_id diff --git a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION index dde25ef08e8..d168f1d8bda 100644 --- a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-sinatra/openapi.yaml b/samples/server/petstore/ruby-sinatra/openapi.yaml index c0b60f85dde..b8e8bf1ec35 100644 --- a/samples/server/petstore/ruby-sinatra/openapi.yaml +++ b/samples/server/petstore/ruby-sinatra/openapi.yaml @@ -1,11 +1,15 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + description: This is a sample server Petstore server. For this sample, you can use + the api key `special-key` to test the authorization filters. license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -20,18 +24,9 @@ paths: post: operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: 405: - content: {} description: Invalid input security: - petstore_auth: @@ -43,24 +38,13 @@ paths: put: operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found 405: - content: {} description: Validation exception security: - petstore_auth: @@ -104,11 +88,9 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid status value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -116,7 +98,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -144,11 +127,9 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid tag value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -157,20 +138,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: 400: - content: {} description: Invalid pet value security: - petstore_auth: @@ -184,12 +169,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: 200: content: @@ -201,10 +188,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found security: - api_key: [] @@ -215,13 +200,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -232,9 +220,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: 405: - content: {} description: Invalid input security: - petstore_auth: @@ -248,13 +236,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -266,6 +257,7 @@ paths: description: file to upload format: binary type: string + type: object responses: 200: content: @@ -304,7 +296,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -320,37 +312,39 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid Order summary: Place an order for a pet tags: - store /store/order/{orderId}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: orderId required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Delete purchase order by ID tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: orderId required: true @@ -359,6 +353,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: 200: content: @@ -370,10 +365,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -384,15 +377,16 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Create user tags: - user @@ -400,18 +394,12 @@ paths: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user @@ -419,18 +407,12 @@ paths: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user @@ -439,17 +421,22 @@ paths: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: 200: content: @@ -461,18 +448,29 @@ paths: type: string description: successful operation headers: + Set-Cookie: + description: Cookie authentication key for use with the `auth_cookie` + apiKey authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when toekn expires + explode: false schema: format: date-time type: string + style: simple 400: - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -482,8 +480,9 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Logs out current logged in user session tags: - user @@ -493,18 +492,20 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found + security: + - auth_cookie: [] summary: Delete user tags: - user @@ -512,11 +513,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: 200: content: @@ -528,10 +531,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found summary: Get user by user name tags: @@ -541,29 +542,61 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: 400: - content: {} description: Invalid user supplied 404: - content: {} description: User not found + security: + - auth_cookie: [] summary: Updated user tags: - user components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -611,6 +644,7 @@ components: format: int64 type: integer name: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string title: Pet category type: object @@ -736,6 +770,25 @@ components: type: string title: An uploaded response type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object securitySchemes: petstore_auth: flows: @@ -749,3 +802,7 @@ components: in: header name: api_key type: apiKey + auth_cookie: + in: cookie + name: AUTH_KEY + type: apiKey diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/rust-server/output/openapi-v3/README.md b/samples/server/petstore/rust-server/output/openapi-v3/README.md index 66109167f3b..d51e1c48832 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/README.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/README.md @@ -61,6 +61,8 @@ cargo run --example server To run a client, follow one of the following simple steps: ``` +cargo run --example client MultipleAuthSchemeGet +cargo run --example client ReadonlyAuthSchemeGet cargo run --example client RequiredOctetStreamPut cargo run --example client ResponsesWithHeadersGet cargo run --example client UuidGet @@ -102,6 +104,8 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[****](docs/default_api.md#) | **GET** /multiple_auth_scheme | +[****](docs/default_api.md#) | **GET** /readonly_auth_scheme | [****](docs/default_api.md#) | **PUT** /required_octet_stream | [****](docs/default_api.md#) | **GET** /responses_with_headers | [****](docs/default_api.md#) | **GET** /uuid | @@ -125,8 +129,22 @@ Method | HTTP request | Description ## Documentation For Authorization - Endpoints do not require authorization. +## authScheme +- **Type**: OAuth +- **Flow**: accessCode +- **Authorization URL**: http://example.org +- **Scopes**: + - **test.read**: Allowed to read state. + - **test.write**: Allowed to change state. + +Example +``` +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. +``` +``` ## Author diff --git a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml index 552e1394d14..e903c1c2fe5 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml @@ -86,6 +86,23 @@ paths: responses: 200: description: OK + /readonly_auth_scheme: + get: + responses: + 200: + description: Check that limiting to a single required auth scheme works + security: + - authScheme: + - test.read + /multiple_auth_scheme: + get: + responses: + 200: + description: Check that limiting to multiple required auth schemes works + security: + - authScheme: + - test.read + - test.write /responses_with_headers: get: responses: @@ -176,4 +193,14 @@ components: xml: name: snake_another_xml_object namespace: http://foo.bar + securitySchemes: + authScheme: + flows: + authorizationCode: + authorizationUrl: http://example.org + scopes: + test.read: Allowed to read state. + test.write: Allowed to change state. + tokenUrl: http://example.org + type: oauth2 diff --git a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md index d6115c696e8..82b8c773ff4 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md @@ -4,6 +4,8 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +****](default_api.md#) | **GET** /multiple_auth_scheme | +****](default_api.md#) | **GET** /readonly_auth_scheme | ****](default_api.md#) | **PUT** /required_octet_stream | ****](default_api.md#) | **GET** /responses_with_headers | ****](default_api.md#) | **GET** /uuid | @@ -14,6 +16,50 @@ Method | HTTP request | Description ****](default_api.md#) | **PUT** /xml | +# **** +> (ctx, ) + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +[authScheme](../README.md#authScheme) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> (ctx, ) + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +[authScheme](../README.md#authScheme) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **** > (body) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs index 6b4bbb64633..dcbe006993a 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs @@ -19,6 +19,8 @@ use tokio_core::reactor; #[allow(unused_imports)] use openapi_v3::{ApiNoContext, ContextWrapperExt, ApiError, + MultipleAuthSchemeGetResponse, + ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, ResponsesWithHeadersGetResponse, UuidGetResponse, @@ -35,6 +37,8 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ + "MultipleAuthSchemeGet", + "ReadonlyAuthSchemeGet", "RequiredOctetStreamPut", "ResponsesWithHeadersGet", "UuidGet", @@ -83,6 +87,16 @@ fn main() { match matches.value_of("operation") { + Some("MultipleAuthSchemeGet") => { + let result = core.run(client.multiple_auth_scheme_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("ReadonlyAuthSchemeGet") => { + let result = core.run(client.readonly_auth_scheme_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + Some("RequiredOctetStreamPut") => { let result = core.run(client.required_octet_stream_put(swagger::ByteArray(Vec::from("BYTE_ARRAY_DATA_HERE")))); println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/mod.rs index ad8904ca16b..2139af63155 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/mod.rs @@ -13,6 +13,7 @@ use std::marker::PhantomData; use hyper; use openapi_v3; use swagger::{Has, XSpanIdString}; +use swagger::auth::Authorization; pub struct NewService{ marker: PhantomData @@ -24,7 +25,7 @@ impl NewService{ } } -impl hyper::server::NewService for NewService where C: Has + Clone + 'static { +impl hyper::server::NewService for NewService where C: Has + Has> + Clone + 'static { type Request = (hyper::Request, C); type Response = hyper::Response; type Error = hyper::Error; diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs index a66ac4e58d7..56c76018177 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs @@ -11,6 +11,8 @@ use swagger::{Has, XSpanIdString}; use uuid; use openapi_v3::{Api, ApiError, + MultipleAuthSchemeGetResponse, + ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, ResponsesWithHeadersGetResponse, UuidGetResponse, @@ -36,6 +38,20 @@ impl Server { impl Api for Server where C: Has{ + fn multiple_auth_scheme_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("multiple_auth_scheme_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn readonly_auth_scheme_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("readonly_auth_scheme_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box> { let context = context.clone(); println!("required_octet_stream_put({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs index 3537ffbd908..b67f0353b29 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs @@ -37,6 +37,8 @@ use swagger; use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData}; use {Api, + MultipleAuthSchemeGetResponse, + ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, ResponsesWithHeadersGetResponse, UuidGetResponse, @@ -248,7 +250,153 @@ impl Client where impl Api for Client where F: Future + 'static, - C: Has { + C: Has + Has>{ + + fn multiple_auth_scheme_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/multiple_auth_scheme", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + (context as &Has>).get().as_ref().map(|auth_data| { + // Currently only authentication with Basic, API Key, and Bearer are supported + match auth_data { + &AuthData::Bearer(ref bearer_header) => { + request.headers_mut().set(hyper::header::Authorization( + bearer_header.clone(), + )) + }, + _ => {} + } + }); + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + MultipleAuthSchemeGetResponse::CheckThatLimitingToMultipleRequiredAuthSchemesWorks + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn readonly_auth_scheme_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/readonly_auth_scheme", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + (context as &Has>).get().as_ref().map(|auth_data| { + // Currently only authentication with Basic, API Key, and Bearer are supported + match auth_data { + &AuthData::Bearer(ref bearer_header) => { + request.headers_mut().set(hyper::header::Authorization( + bearer_header.clone(), + )) + }, + _ => {} + } + }); + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + ReadonlyAuthSchemeGetResponse::CheckThatLimitingToASingleRequiredAuthSchemeWorks + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } fn required_octet_stream_put(&self, param_body: swagger::ByteArray, context: &C) -> Box> { let mut uri = format!( @@ -272,7 +420,6 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Put, uri); - // Body parameter let body = param_body.0; request.set_body(body); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs index 0ccacdce2fc..255d779db32 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs @@ -51,6 +51,18 @@ pub const BASE_PATH: &'static str = ""; pub const API_VERSION: &'static str = "1.0.7"; +#[derive(Debug, PartialEq)] +pub enum MultipleAuthSchemeGetResponse { + /// Check that limiting to multiple required auth schemes works + CheckThatLimitingToMultipleRequiredAuthSchemesWorks +} + +#[derive(Debug, PartialEq)] +pub enum ReadonlyAuthSchemeGetResponse { + /// Check that limiting to a single required auth scheme works + CheckThatLimitingToASingleRequiredAuthSchemeWorks +} + #[derive(Debug, PartialEq)] pub enum RequiredOctetStreamPutResponse { /// OK @@ -131,6 +143,12 @@ pub enum XmlPutResponse { pub trait Api { + fn multiple_auth_scheme_get(&self, context: &C) -> Box>; + + + fn readonly_auth_scheme_get(&self, context: &C) -> Box>; + + fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box>; @@ -160,6 +178,12 @@ pub trait Api { pub trait ApiNoContext { + fn multiple_auth_scheme_get(&self) -> Box>; + + + fn readonly_auth_scheme_get(&self) -> Box>; + + fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box>; @@ -200,6 +224,16 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { + fn multiple_auth_scheme_get(&self) -> Box> { + self.api().multiple_auth_scheme_get(&self.context()) + } + + + fn readonly_auth_scheme_get(&self) -> Box> { + self.api().readonly_auth_scheme_get(&self.context()) + } + + fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box> { self.api().required_octet_stream_put(body, &self.context()) } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/context.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/context.rs index 6f2900b3d70..a377b535b62 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/context.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/context.rs @@ -83,6 +83,16 @@ impl hyper::server::Service for AddContext fn call(&self, req: Self::Request) -> Self::Future { let context = A::default().push(XSpanIdString::get_or_generate(&req)); + { + use hyper::header::{Authorization as HyperAuth, Basic, Bearer}; + use std::ops::Deref; + if let Some(bearer) = req.headers().get::>().cloned() { + let auth_data = AuthData::Bearer(bearer.deref().clone()); + let context = context.push(Some(auth_data)); + let context = context.push(None::); + return self.inner.call((req, context)); + } + } let context = context.push(None::); let context = context.push(None::); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index 72923bf8ee8..2298f08c707 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -35,6 +35,8 @@ use swagger::{ApiError, XSpanId, XSpanIdString, Has, RequestParser}; use swagger::auth::Scopes; use {Api, + MultipleAuthSchemeGetResponse, + ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, ResponsesWithHeadersGetResponse, UuidGetResponse, @@ -56,6 +58,8 @@ mod paths { lazy_static! { pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ + r"^/multiple_auth_scheme$", + r"^/readonly_auth_scheme$", r"^/required_octet_stream$", r"^/responses_with_headers$", r"^/uuid$", @@ -64,12 +68,14 @@ mod paths { r"^/xml_other$" ]).unwrap(); } - pub static ID_REQUIRED_OCTET_STREAM: usize = 0; - pub static ID_RESPONSES_WITH_HEADERS: usize = 1; - pub static ID_UUID: usize = 2; - pub static ID_XML: usize = 3; - pub static ID_XML_EXTRA: usize = 4; - pub static ID_XML_OTHER: usize = 5; + pub static ID_MULTIPLE_AUTH_SCHEME: usize = 0; + pub static ID_READONLY_AUTH_SCHEME: usize = 1; + pub static ID_REQUIRED_OCTET_STREAM: usize = 2; + pub static ID_RESPONSES_WITH_HEADERS: usize = 3; + pub static ID_UUID: usize = 4; + pub static ID_XML: usize = 5; + pub static ID_XML_EXTRA: usize = 6; + pub static ID_XML_OTHER: usize = 7; } pub struct NewService { @@ -80,7 +86,7 @@ pub struct NewService { impl NewService where T: Api + Clone + 'static, - C: Has + 'static + C: Has + Has> + 'static { pub fn new>>(api_impl: U) -> NewService { NewService{api_impl: api_impl.into(), marker: PhantomData} @@ -90,7 +96,7 @@ where impl hyper::server::NewService for NewService where T: Api + Clone + 'static, - C: Has + 'static + C: Has + Has> + 'static { type Request = (Request, C); type Response = Response; @@ -110,7 +116,7 @@ pub struct Service { impl Service where T: Api + Clone + 'static, - C: Has + 'static { + C: Has + Has> + 'static { pub fn new>>(api_impl: U) -> Service { Service{api_impl: api_impl.into(), marker: PhantomData} } @@ -119,7 +125,7 @@ where impl hyper::server::Service for Service where T: Api + Clone + 'static, - C: Has + 'static + C: Has + Has> + 'static { type Request = (Request, C); type Response = Response; @@ -135,6 +141,127 @@ where // Please update both places if changing how this code is autogenerated. match &method { + // MultipleAuthSchemeGet - GET /multiple_auth_scheme + &hyper::Method::Get if path.matched(paths::ID_MULTIPLE_AUTH_SCHEME) => { + { + let authorization = match (&context as &Has>).get() { + &Some(ref authorization) => authorization, + &None => return Box::new(future::ok(Response::new() + .with_status(StatusCode::Forbidden) + .with_body("Unauthenticated"))), + }; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "test.read".to_string(), // Allowed to read state. + "test.write".to_string(), // Allowed to change state. + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Box::new(future::ok(Response::new() + .with_status(StatusCode::Forbidden) + .with_body(missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + )) + )); + } + } + } + Box::new({ + {{ + Box::new(api_impl.multiple_auth_scheme_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + MultipleAuthSchemeGetResponse::CheckThatLimitingToMultipleRequiredAuthSchemesWorks + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + }} + }) as Box> + }, + + // ReadonlyAuthSchemeGet - GET /readonly_auth_scheme + &hyper::Method::Get if path.matched(paths::ID_READONLY_AUTH_SCHEME) => { + { + let authorization = match (&context as &Has>).get() { + &Some(ref authorization) => authorization, + &None => return Box::new(future::ok(Response::new() + .with_status(StatusCode::Forbidden) + .with_body("Unauthenticated"))), + }; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "test.read".to_string(), // Allowed to read state. + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Box::new(future::ok(Response::new() + .with_status(StatusCode::Forbidden) + .with_body(missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + )) + )); + } + } + } + Box::new({ + {{ + Box::new(api_impl.readonly_auth_scheme_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + ReadonlyAuthSchemeGetResponse::CheckThatLimitingToASingleRequiredAuthSchemeWorks + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + }} + }) as Box> + }, + // RequiredOctetStreamPut - PUT /required_octet_stream &hyper::Method::Put if path.matched(paths::ID_REQUIRED_OCTET_STREAM) => { // Body parameters (note that non-required body parameters will ignore garbage @@ -644,6 +771,12 @@ impl RequestParser for ApiRequestParser { let path = paths::GLOBAL_REGEX_SET.matches(request.uri().path()); match request.method() { + // MultipleAuthSchemeGet - GET /multiple_auth_scheme + &hyper::Method::Get if path.matched(paths::ID_MULTIPLE_AUTH_SCHEME) => Ok("MultipleAuthSchemeGet"), + + // ReadonlyAuthSchemeGet - GET /readonly_auth_scheme + &hyper::Method::Get if path.matched(paths::ID_READONLY_AUTH_SCHEME) => Ok("ReadonlyAuthSchemeGet"), + // RequiredOctetStreamPut - PUT /required_octet_stream &hyper::Method::Put if path.matched(paths::ID_REQUIRED_OCTET_STREAM) => Ok("RequiredOctetStreamPut"), diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 63e1edf8d5a..ea6e5e3ff80 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -48,7 +52,8 @@ public interface AnotherFakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index cf10d9d8c2a..e0da87f229b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -81,7 +85,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -152,7 +157,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -254,7 +260,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 43b54cfdea0..9b6e07e39fa 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -50,7 +54,8 @@ public interface FakeClassnameTestApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index c191ae98ae2..24e1c50c377 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -90,11 +94,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -122,11 +128,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -152,11 +160,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -221,7 +231,8 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 32991ddd02f..ab23e2c195c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -76,11 +80,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -103,11 +109,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 5aa4f1294ef..5d93559a277 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -95,11 +99,13 @@ public interface UserApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8fa8de8b913..2cd2c02b27d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -46,7 +50,8 @@ public interface AnotherFakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 32cfc87d4d2..155e566b564 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -79,7 +83,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -148,7 +153,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -248,7 +254,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4c71a45705f..3a77e434953 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -48,7 +52,8 @@ public interface FakeClassnameTestApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index bf81229c362..80c1136b536 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -88,11 +92,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -118,11 +124,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -146,11 +154,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -213,7 +223,8 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 40885e360d5..fe1329b090a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,11 +78,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -99,11 +105,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 5eaa8ab6edd..9616a10ae48 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -93,11 +97,13 @@ public interface UserApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index a7e416f15a6..0505a5a595f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 5043c58114f..fb922708cb0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -34,7 +34,8 @@ public class AnotherFakeApiController implements AnotherFakeApi { public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 56d21638b37..639cbd888b6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index dc60b728055..1778cc30e75 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -54,7 +54,8 @@ public class FakeApiController implements FakeApi { public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -85,7 +86,8 @@ public class FakeApiController implements FakeApi { public ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -126,7 +128,8 @@ public class FakeApiController implements FakeApi { public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4973979dc19..26e45e58a63 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index a3b9ad557a7..d2642a4ceeb 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -34,7 +34,8 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi { public ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 8c386ce6d16..88392fcd57d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java index 53c37962bdf..b1e82a3f737 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java @@ -46,11 +46,13 @@ public class PetApiController implements PetApi { public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -61,11 +63,13 @@ public class PetApiController implements PetApi { public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -76,11 +80,13 @@ public class PetApiController implements PetApi { public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -101,7 +107,8 @@ public class PetApiController implements PetApi { public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index af2ec901102..d0c507d7287 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java index acddbe96352..63aa57e3c02 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java @@ -45,11 +45,13 @@ public class StoreApiController implements StoreApi { public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -60,11 +62,13 @@ public class StoreApiController implements StoreApi { public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 53236596909..af95ccd11e7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java index 40b796dc32d..6c7ad6eaf7e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java @@ -55,11 +55,13 @@ public class UserApiController implements UserApi { public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index a7e416f15a6..0505a5a595f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 28462f31ab3..a01520a180f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -34,7 +34,8 @@ public class AnotherFakeApiController implements AnotherFakeApi { public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 56d21638b37..639cbd888b6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index d03f6b39ba5..af119a493c4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -54,7 +54,8 @@ public class FakeApiController implements FakeApi { public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -85,7 +86,8 @@ public class FakeApiController implements FakeApi { public ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -126,7 +128,8 @@ public class FakeApiController implements FakeApi { public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4973979dc19..26e45e58a63 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index b749d734b41..378b0d9a486 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -34,7 +34,8 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi { public ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index 8c386ce6d16..88392fcd57d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index bf3d57f90aa..b263f984ecd 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -46,11 +46,13 @@ public class PetApiController implements PetApi { public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -61,11 +63,13 @@ public class PetApiController implements PetApi { public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -76,11 +80,13 @@ public class PetApiController implements PetApi { public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -101,7 +107,8 @@ public class PetApiController implements PetApi { public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index af2ec901102..d0c507d7287 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java index 28ce69c093d..6d52b0acce5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java @@ -45,11 +45,13 @@ public class StoreApiController implements StoreApi { public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -60,11 +62,13 @@ public class StoreApiController implements StoreApi { public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 53236596909..af95ccd11e7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java index 58f252ae90a..d87450cf58e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java @@ -55,11 +55,13 @@ public class UserApiController implements UserApi { public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 6b98d70b930..8c578690a99 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index bdefef0d331..a8c46f16e4a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -30,7 +30,8 @@ public interface AnotherFakeApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 24a80478964..c22e2a41e10 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index 03441e760eb..9f4a2692e9e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -56,7 +56,8 @@ public interface FakeApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -105,7 +106,8 @@ public interface FakeApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -201,7 +203,8 @@ public interface FakeApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 51bf2839e5e..9764c46c07d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 3e95af6de1c..df29ad43a89 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -30,7 +30,8 @@ public interface FakeClassnameTestApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 9748031902c..fd22a70d339 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index b2b7360f4dc..ea1a5ebed50 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -49,11 +49,13 @@ public interface PetApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -69,11 +71,13 @@ public interface PetApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -89,11 +93,13 @@ public interface PetApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -129,7 +135,8 @@ public interface PetApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 689f4a33256..6af9c14bf5e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index 995ff1dc25f..036309ceb6f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -47,11 +47,13 @@ public interface StoreApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -67,11 +69,13 @@ public interface StoreApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index da8a224572a..c9ee681a28d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index bc3af703973..c90d5e72219 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -63,11 +63,13 @@ public interface UserApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index a7e416f15a6..0505a5a595f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 56d21638b37..639cbd888b6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4973979dc19..26e45e58a63 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 8c386ce6d16..88392fcd57d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index af2ec901102..d0c507d7287 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 53236596909..af95ccd11e7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 6ddfe50f99f..15124902084 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -48,7 +52,8 @@ public interface AnotherFakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index fdf66ff180f..e3caa7c89a9 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -85,7 +89,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -164,7 +169,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -282,7 +288,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 5aab954eb9c..49dabd4525f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -50,7 +54,8 @@ public interface FakeClassnameTestApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 728c82ef621..10ed8a65591 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -95,11 +99,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -127,11 +133,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -157,11 +165,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -230,7 +240,8 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 4d78ab6694f..77c8aabdedb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -80,11 +84,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -107,11 +113,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index d44e1ec9b8c..4822417256b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -103,11 +107,13 @@ public interface UserApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index dfc5042c0ab..e71c92ee5ba 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index a67f2f5387c..549a66207fa 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -35,7 +35,8 @@ public interface AnotherFakeApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 9a66176f085..022857bb2e2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index 2c23dcd502b..c61a3d26c7c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -67,7 +67,8 @@ public interface FakeApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } @@ -129,7 +130,8 @@ public interface FakeApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } @@ -244,7 +246,8 @@ public interface FakeApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 25b16bafabd..91613336301 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index d99a6739626..0373ca1aec3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -35,7 +35,8 @@ public interface FakeClassnameTestApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 65d46836963..df9c52bc555 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 630d4a3f99d..f8f3d8fd98c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -60,11 +60,13 @@ public interface PetApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - result = ApiUtil.getExampleResponse(exchange, " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } @@ -81,11 +83,13 @@ public interface PetApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - result = ApiUtil.getExampleResponse(exchange, " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } @@ -102,11 +106,13 @@ public interface PetApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - result = ApiUtil.getExampleResponse(exchange, " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } @@ -149,7 +155,8 @@ public interface PetApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 8ae70a6c299..74b1d581521 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 72fb559347e..672d1dbb8d3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -57,11 +57,13 @@ public interface StoreApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - result = ApiUtil.getExampleResponse(exchange, " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } @@ -78,11 +80,13 @@ public interface StoreApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - result = ApiUtil.getExampleResponse(exchange, " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 4a975b1efc2..592ddb205e1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 156ba16a769..13994de33a8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -80,11 +80,13 @@ public interface UserApiDelegate { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - result = ApiUtil.getExampleResponse(exchange, " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + result = ApiUtil.getExampleResponse(exchange, exampleString); break; } } diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8fa8de8b913..2cd2c02b27d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -46,7 +50,8 @@ public interface AnotherFakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index d99dfcfdf7c..83cb58a7868 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -79,7 +83,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -148,7 +153,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -248,7 +254,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4c71a45705f..3a77e434953 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -48,7 +52,8 @@ public interface FakeClassnameTestApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 693650765b6..5cd8b894be7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -88,11 +92,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -118,11 +124,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -146,11 +154,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -213,7 +223,8 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 40885e360d5..fe1329b090a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,11 +78,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -99,11 +105,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 5eaa8ab6edd..9616a10ae48 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -93,11 +97,13 @@ public interface UserApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index a32444dc065..0fee2d57eb9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -50,7 +54,8 @@ public interface AnotherFakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index ad1e9edc14c..e0bb9a1300f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -85,7 +89,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -159,7 +164,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -266,7 +272,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 4797a715471..f0140cbf870 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -52,7 +56,8 @@ public interface FakeClassnameTestApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 82e7d980a68..9ff34c2b799 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -94,11 +98,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -125,11 +131,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -154,11 +162,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -224,7 +234,8 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index aebd4fedf3c..dbcdc258f6a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -80,11 +84,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -106,11 +112,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index f8718d54bd8..b165a3487a0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -101,11 +105,13 @@ public interface UserApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index d99e7162d01..92a8e296fac 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1,5 @@ -5.0.0-SNAPSHOT \ No newline at end of file +<<<<<<< HEAD +5.0.0-SNAPSHOT +======= +4.3.0-SNAPSHOT +>>>>>>> 4.3.x diff --git a/samples/server/petstore/springboot/pom.xml b/samples/server/petstore/springboot/pom.xml index d4227500a1d..6d6b85134ae 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/pom.xml @@ -4,7 +4,7 @@ springboot jar springboot - 1.0.0 + 1.0.0-SNAPSHOT 1.8 ${java.version} diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8fa8de8b913..2cd2c02b27d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -46,7 +50,8 @@ public interface AnotherFakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index d4e51017afe..eb2d35bc24f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -79,7 +83,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true}"); + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); break; } } @@ -148,7 +153,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } @@ -248,7 +254,8 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4c71a45705f..3a77e434953 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -48,7 +52,8 @@ public interface FakeClassnameTestApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index bf81229c362..80c1136b536 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -88,11 +92,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -118,11 +124,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -146,11 +154,13 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -213,7 +223,8 @@ public interface PetApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 40885e360d5..fe1329b090a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,11 +78,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } @@ -99,11 +105,13 @@ public interface StoreApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 5eaa8ab6edd..9616a10ae48 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,9 @@ /** +<<<<<<< HEAD * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.0-SNAPSHOT). +======= + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). +>>>>>>> 4.3.x * https://openapi-generator.tech * Do not edit the class manually. */ @@ -93,11 +97,13 @@ public interface UserApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); break; } } diff --git a/website/dynamic/users.yml b/website/dynamic/users.yml index 457c2371db3..e366ab1d08b 100644 --- a/website/dynamic/users.yml +++ b/website/dynamic/users.yml @@ -118,6 +118,11 @@ image: "img/companies/formapi.png" infoLink: "https://formapi.io/" pinned: false +- + caption: "FreshCells" + image: "img/companies/freshcells.png" + infoLink: "https://www.freshcells.de/" + pinned: false - caption: "Fuse" image: "img/companies/fuseno.png" @@ -158,6 +163,11 @@ image: "img/companies/klarna.svg" infoLink: "https://www.klarna.com/us/" pinned: false +- + caption: "Kronsoft Development" + image: "img/companies/kronsoft.svg" + infoLink: "https://www.kronsoft.ro/home/" + pinned: false - caption: "Médiavision" image: "img/companies/mediavision.jpeg" @@ -218,6 +228,11 @@ image: "img/companies/prometheus.png" infoLink: "https://github.com/prometheus/alertmanager" pinned: false +- + caption: "Qulix Systems" + image: "img/companies/qulix.png" + infoLink: "https://www.qulix.com" + pinned: false - caption: "Raiffeisen Schweiz Genossenschaft" image: "img/companies/raiffeisen.png" diff --git a/website/static/img/companies/freshcells.png b/website/static/img/companies/freshcells.png new file mode 100644 index 00000000000..e3780a4ff38 Binary files /dev/null and b/website/static/img/companies/freshcells.png differ diff --git a/website/static/img/companies/kronsoft.png b/website/static/img/companies/kronsoft.png new file mode 100644 index 00000000000..201de65655a Binary files /dev/null and b/website/static/img/companies/kronsoft.png differ diff --git a/website/static/img/companies/qulix.png b/website/static/img/companies/qulix.png new file mode 100644 index 00000000000..57e6bc55a43 Binary files /dev/null and b/website/static/img/companies/qulix.png differ